API documentation

Everything you need to call the BIN lookup API, generated from one authoritative schema.

Only first 6–8 digits. Full card numbers are rejected.

Overview

Bindex resolves the first 6–8 digits of a payment card (a BIN / IIN) to its issuer, scheme, funding type, product tier and issuing country. The index is maintained continuously; no third-party BIN API is called at request time. Everything below is generated from one authoritative schema, so the docs, the interactive tester, the code samples and the live response cannot disagree.

Safety & truthfulness — read this first.
  • Only first 6–8 digits. Full card numbers are rejected. The only accepted input is a 6–8 digit IIN.
  • A 13–19 digit input → 422 FULL_PAN_REJECTED before any lookup, metering or logging; the input is never stored or echoed.
  • matched_on is truthful — exact, 6-digit-prefix or none. An 8-digit BIN is never fabricated from a 6-digit record.
  • number.length and number.luhn are BIN-range metadata, NOT validation of submitted card numbers (we never accept one).

Base URL: https://bindex.cc. All customer endpoints live under /api/v1; the binlist-compatible alias is /bin/{bin}. The public OpenAPI schema is request-aware and hides internal namespaces.

Authentication

Send your API key in the X-API-Key header. Keys are shown once and never logged. The header is X-API-Key (case-insensitive) — never a query parameter, never in the URL, never in a body. Keys are hashed at rest (SHA-256 key_hash plus a masked key_prefix); the raw key is never stored.

Keys are reveal-once: the full value is shown a single time at creation ("Shown once — store it now") and never returned by any later read, never logged, never recoverable. A missing or bad key is 401 MISSING_API_KEY / 401 INVALID_API_KEY with WWW-Authenticate: ApiKey. A valid-but-disallowed credential is 403 (KEY_REVOKED, ACCOUNT_SUSPENDED, ADMIN_REQUIRED, ENTITLEMENT_REQUIRED).

The console uses a session token as Authorization: Bearer … for account endpoints, but API lookups are never authenticated by session alone — they require X-API-Key. Example keys in this documentation are always a bx_live_… placeholder; never embed a real key in source or a URL.

Lookup

GET /api/v1/bins/{bin} — {bin} is a 6–8 digit IIN (^\d{6,8}$). With X-API-Version: 2 the response is the canonical flat schema below; the default (v1) keeps the frozen nested BinResponse wrapper forever. An optional fields query parameter projects canonical field names (aliases resolve to their target).

Rejections happen before metering: non-numeric, fewer than 6, 9–12 or more than 19 digits → 400 INVALID_PREFIX; 13–19 digits → 422 FULL_PAN_REJECTED. A well-formed no-match returns HTTP 200 with matched_on: "none" and every data field null — 404 is reserved for the binlist-compat path only.

Canonical response — full field dictionary

Every field of the X-API-Version: 2 flat representation (plan/04 §2). Containers: issuer, country, number.
Field Type Description
binstring, 6–8 digitsThe BIN the matched record belongs to; echoes the queried prefix when matched_on:"none".
matched_onexact | 6-digit-prefix | noneResolution truthfulness; closed enum, computed by the lookup, never by the client.
schemestring | nullCard network (Visa, Mastercard …), preserved verbatim; never re-cased.
brandstring | nullCo-brand / product label; derived only from Bindex-verified enrichment, null when not derivable, never scraped.
funding_typeopen enum | nullNormalized funding source (credit / debit / deferred_debit / prepaid / prepaid_reloadable / charge); open taxonomy.
typealiasPermanent alias of funding_type; always byte-equal.
product_levelstring | nullIssuer product tier (Standard, Gold, Platinum, Business …); free-text, never coerced.
levelaliasPermanent alias of product_level.
issuer.namestring | nullIssuer name.
issuer.slugstring | nullStable lower-cased punctuation-normalized slug; null when no name.
issuer.phonestring | nullVerified phone only; never synthesized from the issuer name.
issuer.websitestring | nullVerified URL only.
issuer.citystring | nullVerified city only; null otherwise.
bank_namealiasPermanent alias of issuer.name.
country.namestring | nullIssuing country name.
country.codeISO 3166-1 alpha-2 | nullTwo-letter country code.
country.numericstring | nullISO 3166-1 numeric code, as a string.
country.emojistring | nullFlag emoji; null when no code.
country.currencyISO 4217 | nullCurrency code; null when unverifiable.
country.latitudenumber | nullCoarse country centroid — not IP geolocation, not a street/household location.
country.longitudenumber | nullCoarse country centroid.
country_namealiasPermanent alias of country.name.
country_codealiasPermanent alias of country.code.
prepaidboolean | nullTri-state: true / false / null (unknown). Null is preserved, never defaulted to false.
number.lengthinteger 13–19 | nullBIN-range metadata: typical card-number length of the range; null when unknown.
number.luhnboolean | nullBIN-range metadata: whether the range uses Luhn mod-10; null when unknown.
record_dateISO 8601 date | nullDate the source row was written / last confirmed.
last_verifiedISO 8601 datetime | nullWhen the index was last rebuilt and verified.
sourcestring | nullOpaque provenance token; never the corpus source list, URLs or dump locations.
confidenceverified | standard | lowTruthfulness grade; closed enum. A 6-digit-prefix or none result is never verified.
number.length / number.luhn — BIN-range metadata, not PAN validation.

These two fields describe the BIN range: the typical card-number length of that IIN range, and whether the range uses the Luhn mod-10 check-digit scheme. They are sourced from the dataset at import (persisted range columns), never fabricated or inferred at query time; null when unknown. They are range metadata, not validation of any submitted full card number (we never accept one). Bindex never receives, computes, validates or stores a full card number, PAN, CVV or expiry.

matched_on values

Exact match a row with the same bin matched. 6-digit-prefix match an 8-digit query fell back to its first 6 digits — "no exact 8-digit record exists; no digits were inferred"; the response's bin is the 6-digit row and confidence is standard at best. No match no row matched; HTTP 200 with every data field null. bin, matched_on and confidence are always internally consistent.

Batch

POST /api/v1/bins/batch. Frozen form {"bins": ["457173", "411111"]} — 1–500 rows of 6–8 digit IINs. The v2 form additionally allows correlated rows {"rows": [{"id": "row-1", "bin": "457173"}]}; bins and rows are mutually exclusive. Every row is validated before any lookup is metered: a malformed row rejects the whole batch with 422 (v1) before any charge.

In v2 each row resolves independently and carries its own matched_on / confidence or a per-row error object with codes INVALID_PREFIX, FULL_PAN_REJECTED, NO_MATCH (informational), RATE_LIMITED, ENTITLEMENT_REQUIRED. Only successfully resolved rows are metered; a row that errors is never charged. results has the same length and order (or id correlation) as the input — no silent drops.

JSON + CSV export. Accept: application/json (default) returns BatchResponse; Accept: text/csv (v2) returns one header row plus one line per input row with the canonical field set flattened (issuer.name, country.code, number.length …), RFC 4180-quoted. CSV consumes the same auth, quota, rpm and per-row metering as JSON — it is not an export bypass, and never exposes the corpus source list.

Metering. Each valid BIN costs one token. Prepaid zero tokens → 402 before the batch runs; free-tier daily/monthly caps count each row; a 422-before-metering batch costs nothing; the 1000-token pack floor holds.

Filtering

GET /api/v1/bins with query params: issuer, scheme, type, country_code, brand (new enrichment), limit (1–500, default 25), offset (≥ 0) and page (1-based; when both page and offset are supplied, page takes precedence). Null-brand rows are excluded when brand is supplied.

Pagination caps. Max 500 rows per response, no whole-corpus dump. total is exposed additively as X-Total-Count plus RFC 8288 Link headers (rel=next/prev/last); the body stays list[dict], never wrapped. Accept: text/csv (v2) returns the same filter result as CSV.

Usage

GET /api/v1/me/usage (KEY) returns UsageResponse: key_id, plan, requests_this_month, monthly_quota, remaining, requests_per_minute, total_requests, hits. A zero limit is reported as the string "unlimited" (never 0 or null). v2 adds daily_quota, daily_used, requests_today, requests_per_minute_remaining, quota_resets_at, rate_window_resets_at — additive only.

Errors

Distinct states for malformed input, no match, out of tokens and rate limiting. Every error uses a stable JSON envelope with four keys: { "code": "…", "message": "…", "hint": "…", "request_id": "req_…" }. code is a stable uppercase enum, message is short and secret-free, hint is an actionable next step, and request_id echoes X-Request-ID on every response. v1 keeps the frozen detail key alongside the four; v2 is exactly the four. The single exception: 404 NO_MATCH on /bin/{bin} has an empty body for binlist drop-in fidelity. No error body ever contains a PAN, CVV, key, token, source URL, internal hostname or raw stack trace.

Status / code table
HTTPcode When
400INVALID_PREFIX / INVALID_REQUESTMalformed prefix, filter/pagination value, IP, or batch body.
401MISSING_API_KEY / INVALID_API_KEYAbsent or bad X-API-Key.
402OUT_OF_TOKENSPrepaid zero-token balance (a billing state, not auth).
403KEY_REVOKED / ACCOUNT_SUSPENDED / ADMIN_REQUIRED / ENTITLEMENT_REQUIRED / SPOOFED_CLIENT_IPCredential valid but action not permitted.
404NO_MATCH / NOT_FOUNDCompat path no-match (empty body), or unknown route.
410GONEEndpoint/field whose published deprecation window closed.
422FULL_PAN_REJECTED / INVALID_BIN13–19 digits rejected before metering, or v1 whole-batch validation.
429RATE_LIMITED / QUOTA_EXCEEDEDPer-key rpm / per-IP rpm / daily 10 / monthly 300 quota.
500INTERNAL_ERRORUnexpected server fault; never echoes a secret, PAN or stack trace.

Example response

{
  "code": "OUT_OF_TOKENS",
  "message": "This key has no tokens left.",
  "hint": "Buy a token pack to keep looking up BINs.",
  "request_id": "req_…"
}
{
  "code": "FULL_PAN_REJECTED",
  "message": "Only first 6–8 digits. Full card numbers are rejected.",
  "hint": "Send a 6–8 digit IIN, never a full card number.",
  "request_id": "req_…"
}

Rate limits

Rate-limit headers are emitted on every API response (2xx, 4xx, 5xx, including /api/v1/public/*, /bin/{bin} and /healthz): X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (UTC epoch seconds), X-RateLimit-Scope (key | ip | quota-day | quota-month). Unlimited limits report the string unlimited. On 429 only, Retry-After: 60 (rate window) or Retry-After: 3600 (quota window) is returned.

Per-key quotas. requests_per_minute (0 = unlimited, sliding 60 s window), monthly_quota (0 = unlimited → "unlimited"), and the signup allowance of 10 lookups/day + 300/month (daily counter resets 00:00 UTC, independent of the monthly cap). Per-key overrides are honoured and attributed to the key.

Quota-exceeded behaviour. Hitting any allowance → 429 QUOTA_EXCEEDED with an upgrade CTA and the exact copy: "You've hit your plan's lookup allowance. Upgrade your plan or add a token pack to keep looking up BINs." A prepaid wallet at zero tokens is a distinct 402 OUT_OF_TOKENS (not a 429). No 429 or 402 ever credits tokens.

Token floor & metering. One token = one successful lookup. Invalid input and full-PAN input consume nothing (rejected 422 before metering). Credits never expire. Token packs have a 1000-token minimum (a pack below 1000 → 422); there is no free ride and no 1-token pack.

Versioning

Version is selected by header: X-API-Version (canonical) or Accept-Version (tolerated alias on /api/v1/*). No version header → version 1 (pinned default, frozen nested wrapper, detail errors). X-API-Version: 2 → the canonical flat schema, JSON error envelope, per-row batch errors, CSV and fields projection. Every response echoes X-API-Version: <effective>. An unknown or conflicting version → 400 UNSUPPORTED_API_VERSION, never a silent fallback.

Additive-only policy. Fields may be added (nullable/defaulted); never removed, renamed, retyped, re-nested or re-status-coded. The five flat aliases (type, level, bank_name, country_name, country_code) stay forever. Open taxonomies gain members without a version bump; closed enums (matched_on, confidence) never grow. Every addition ships with a contract test and a changelog row.

Deprecation. Announced in Changelog with api-version, date, change, compat-impact; signalled on the wire with Deprecation: true, Sunset (RFC 7231 HTTP-date) and Link: …; rel="deprecation"; kept working for at least 2 released API versions AND 180 days; only after the Sunset date may it return 410 GONE. No existing /api/v1 endpoint is deprecated by this upgrade.

Compatibility (binlist-style)

GET /bin/{bin} is a separate, additive, KEY-authenticated drop-in. Send Accept-Version: 3 for the binlist field shape; with no header (or Accept-Version: 1) it returns the Bindex canonical schema. X-API-Version has no effect here. It runs the same check_rate_limit → check_quota chain (no free ride) and keeps matched_on truthful internally.

A no-match is 404 with an empty body (plus standard headers) — the single documented exception to the JSON envelope. 429 uses Retry-After + X-RateLimit-*; all other statuses use the standard envelope. The three binlist-mandated renames exist only on /bin/{bin} and never leak into /api/v1.

Canonical ↔ binlist field mapping (Accept-Version: 3)
Canonical (§2) binlist /bin/{bin} Rule
number.lengthnumber.lengthidentical
number.luhnnumber.luhnidentical; still range metadata
schemeschemeidentical
funding_type / typetyperename; alias collapses
brandbrandidentical
prepaidprepaidtri-state → boolean | null
country.namecountry.nameidentical
country.code / country_codecountry.alpha2rename (alpha-2)
country.numericcountry.numericidentical, string
country.emojicountry.emojiidentical
country.currencycountry.currencyidentical
country.latitude / country.longitudecountry.latitude / country.longitudeidentical
issuer.name / bank_namebank.namerename
issuer.websitebank.urlrename (url, not website)
issuer.phonebank.phoneidentical
issuer.citybank.cityidentical
bin, matched_on, confidence, source, product_level, issuer.slug, country_name, record_date, last_verified—omitted (not in the binlist shape)

IP Intelligence

New, additive, KEY-authenticated, metered and entitlement-gated endpoints (none touches the credit gate; all are data, never payment proof):

  • GET / POST /api/v1/intelligence/bin-ip — BIN + optional explicit IP → country-match intelligence.
  • GET /api/v1/intelligence/ip — IP-only intelligence (geo, network, signals, score, risk label).
  • GET /api/v1/intelligence/fraud/{ip} — full fraud/risk check; paid entitlement: a key without it → 403 ENTITLEMENT_REQUIRED.

Entitlement & providers. A paid intelligence entitlement is required; lower tiers get a read-only schema preview and an upgrade CTA, never a live provider call. Results are normalized across providers: maxmind scamalytics ipqs — each provider chip carries a status (success | error | disabled | cached). Fields with no provider source are null (or the unknown risk label), never invented; a derived or plan-gated value is labelled as such in note.

Privacy — explicit IP parameter, never silent inference. IP intelligence is opt-in: pass an explicit ip parameter (or use POST with a JSON body so the IP never enters a URL). We never silently infer an IP from a plain BIN lookup — a BIN lookup never processes an IP. When an IP-only endpoint is called without ip, the caller's IP is resolved through the trusted-proxy chain (a spoofed CF-Connecting-IP from a non-edge source → 403 SPOOFED_CLIENT_IP). IP is personal data: a lawful basis, a DPA with each vendor, data minimisation and a subject-access/erasure path are shipping preconditions. Geo coordinates are coarse country-level, never street/household precision. No PAN/CVV anywhere.

  • Risk signals are probabilistic.
  • No automated adverse decision should be based solely on these signals.
  • Country mismatch is not proof of fraud.

Signals are informational and do not prove fraud. Provider status badges show healthy / degraded / unavailable; a failed or unconfigured provider returns status:"degraded" with no invented score. Overall risk is normalized into low|medium|high|unknown.

Code examples

Example request — GET /api/v1/bins/45717360 against the canonical schema. Every example reads the key from an environment variable (BINDEX_API_KEY), never embeds a literal credential, uses a 6–8 digit IIN only, contains no price, handles the {code,message,hint,request_id} envelope and one 429 Retry-After path, and links to /docs. Examples use a bx_live_… placeholder wherever a key is shown.

# BINDEX_API_KEY is set in your shell; never hardcode the key.
curl -sS -D - 'https://bindex.cc/api/v1/bins/45717360' \
  -H "X-API-Key: $BINDEX_API_KEY" \
  -H 'X-API-Version: 2'
# 429: read Retry-After; inspect X-RateLimit-* response headers.
# Compat: curl -H 'Accept-Version: 3' 'https://bindex.cc/bin/45717360'

API tester

Never send or log a full card number — 8 digits max. The tester is read-only: it calls lookup/data GET endpoints only, never a purchase, verify or webhook (no credit path). Your key is used only in the request header object; displayed headers and the copy-cURL command always carry a bx_live_… placeholder, never a real key.

Only first 6–8 digits. Full card numbers are rejected.
Reveal-once keys shown with a bx_live_… placeholder; never stored or logged.
Mode

Ready.

Example request URL

—

Request headers (placeholder key)

—

Request JSON

—

Status code + friendly label

—

Response time

—

Example response JSON

—

Integrate Bindex with AI agents

Paste the prompt below into your coding agent (Cursor, Claude Code, Windsurf, ChatGPT). It points the agent at the machine-readable docs and the live OpenAPI schema. Generated from the real public OpenAPI + live dataset metadata.

/llms.txt (index of public routes + agent instructions) - /llms.txt.md (Markdown) - /llms-full.txt + /.well-known/llms-full.txt (de-facto full docs) - /docs.md (Markdown guide, field dictionary, 6 code tabs) - /changelog.json (dataset-release metadata + real changelog titles, coverage counts only) - /ai / /integrate (copy-paste prompt page).

Copy-paste prompt: /ai. /docs also sends a Link: header for /docs.md and /llms.txt.

Send only 6-8 digit prefixes. The header name is X-API-Key and the MCP auth scheme is Bearer; never paste a real key value into a prompt or a commit.

MCP server

POST /mcp (Streamable HTTP, protocol 2026-07-28). Auth: Authorization: Bearer <your API key> - the same scoped, revocable key as REST X-API-Key.

ToolPurposeTokens
lookup_binOne 6-8 digit prefix1/call
batch_lookup_binsSeveral prefixes1/valid row
get_usage, get_limits, get_dataset_status, browse_directoryRead-only aggregatesincluded
1 MCP call = 1 API call = 1 token; 402 / 429 pass through; a 13-19 digit full number is rejected pre-metering with 422 FULL_PAN_REJECTED.
POST /mcp
Authorization: Bearer <your API key>
{"jsonrpc":"2.0","id":1,"method":"tools/list"}

Sandbox / test BINs

Reserved 999999xx 8-digit prefixes exercise every lookup shape with no corpus hit. Bodies are labelled test_mode: true / synthetic: true (issuer Example Issuer (synthetic), country XX, confidence low). Flag off (default) = normal no-match; nothing counted, cached or charged.

BINBehaviour
99999901Exact synthetic record
999999026-digit-prefix fallback
99999999No match
99999904429 + Retry-After
99999905422 INVALID_BIN
Shape-only fixtures, never dataset rows or metered. Try a sandbox BIN in the API tester loads 99999901. Provenance/freshness indicator only - it does not grade any card, issuer or transaction.

Outbound webhooks

Standard Webhooks v1.0.0: headers webhook-id (idempotency key), webhook-timestamp (unix seconds), webhook-signature (v1,<base64>). Signature = HMAC-SHA256 over raw bytes msg_id.timestamp.payload, constant-time verify, 300-second replay window.

Event (frozen)Meaning
usage.thresholdUsage crossed a threshold
quota.exhaustedQuota exhausted (402)
payment.completedTop-up completed - notification only

CRUD at /api/v1/me/webhooks (list, create, delete, rotate, test, deliveries, replay). The signing secret shows once on create/rotate; every other response carries only an opaque secret_ref - the value lives in a file store, never the DB, logs or payloads. Rotation signs current + previous for a grace window. HTTPS + SSRF-checked URLs; queued events deliver out-of-band, never blocking a lookup.

A notification is never proof — only the gateway's own API can move money. Outbound webhooks never authorize credits: a payment.completed event leaves every credit table byte-for-byte unchanged.

Official SDKs

Two MIT-licensed open-source clients generated from the frozen public OpenAPI surface (lookup, batch, usage, limits); the key is a constructor argument sent as X-API-Key, never hardcoded.

pip install bindex          # Python (source tree until published)
import os
from bindex import BindexClient
client = BindexClient(api_key=os.environ["BINDEX_API_KEY"])
record = client.lookup("457173")   # 6-8 digits only
npm install @bindex/sdk     # JS/TS, ESM, Node 18+
import { BindexClient } from "@bindex/sdk";
const client = new BindexClient({ apiKey: process.env.BINDEX_API_KEY });
const record = await client.lookup("457173");   // 6-8 digits only
Both reject a 13-19 digit full number locally. confidence is provenance, never a fraud/accuracy verdict. Prices are never hardcoded - read /api/v1/packs and /api/v1/plans.

Confidence score

Every real lookup carries a 0-100 confidence score (bands: verified 80-100 standard 50-79 low 0-49) derived from data provenance only: source agreement, trust tier, conflicting fields, recency. Additive - the closed confidence enum and exact wire shape are unchanged.

Honest limits. The score is informational - a provenance/freshness indicator, never a fraud verdict, accuracy guarantee, approval signal or statement about a card. BIN data is indicative, changes as ranges are reassigned, and must not be the sole basis for an adverse decision. Country mismatch is not proof of fraud. Synthetic sandbox records carry no score.