GnistAI GnistAI
Log in

Getting Started with BIN Lookup

BIN (Bank Identification Number) lookup — identify card brand, type, and category from the first 6-8 digits.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Finance

Data source: Well-known public BIN prefix ranges

Overview

BIN Lookup wraps Well-known public BIN prefix ranges, handling authentication, pagination, and rate limits for you. This tutorial covers all 3 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-bin-lookup": {
      "url": "https://context.gnist.ai/mcp/bin-lookup/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (3)

lookup_bin

Identify the card brand, type, and category from a Bank Identification Number (BIN). Matches the input against well-known public BIN prefix ranges for Visa, Mastercard, American Express, Discover, JCB, UnionPay, Diners Club, and Maestro. Args: bin_digits: The first 6-8 digits of a payment card number.

ParameterTypeRequiredDescription
bin_digitsstringrequiredFirst 6-8 digits of a payment card number.
curl -X POST "https://context.gnist.ai/mcp/bin-lookup/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "lookup_bin", "arguments": {"bin_digits": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/bin-lookup/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'bin_digits': 'example'}, 'name': 'lookup_bin'}},
)
print(resp.json())

get_card_brands

List all card brands that can be identified from BIN prefixes. Returns the sorted list of known card brands (e.g. Visa, Mastercard, etc.).

curl -X POST "https://context.gnist.ai/mcp/bin-lookup/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_card_brands", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/bin-lookup/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'get_card_brands'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/bin-lookup/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/bin-lookup/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

FAQ

What data does BIN Lookup provide?

BIN (Bank Identification Number) lookup — identify card brand, type, and category from the first 6-8 digits. It exposes 3 tools: lookup_bin, get_card_brands, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the BIN Lookup API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials