# BIN Lookup (`greip/bin-lookup`) Actor

Lookup/validate any Bank Identification Numbers (BINs) and retrieve comprehensive card information including scheme, bank details, and country information. Ideal for payment processing, fraud detection, and card validation.

- **URL**: https://apify.com/greip/bin-lookup.md
- **Developed by:** [Greip](https://apify.com/greip) (community)
- **Categories:** Developer tools, E-commerce, Other
- **Stats:** 31 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.12 / 1,000 requests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Greip's BIN/IIN Lookup

A powerful Apify Actor that analyzes Bank Identification Numbers (BIN) and Issuer Identification Numbers (IIN) using the **Greip BIN Lookup API**. This tool retrieves comprehensive information about debit and credit cards to enhance fraud detection, payment verification, and customer experience.

### 🚀 Features

- **Card Validation**: Comprehensive BIN/IIN validation and analysis
- **Card Type Detection**: Identify whether card is debit or credit
- **Scheme Information**: Get card scheme details (Visa, Mastercard, etc.)
- **Bank Details**: Retrieve issuing bank information and location
- **Brand Recognition**: Identify card brand (Traditional, Gold, Platinum, etc.)
- **Fraud Prevention**: Detect blacklisted BINs and suspicious patterns
- **Structured Output**: Clean, well-formatted JSON results stored in datasets

### Input Parameters

| Parameter | Type   | Required | Description                            |
| --------- | ------ | -------- | -------------------------------------- |
| `bin`     | string | ✅       | BIN/IIN of the card (minimum 6 digits) |
| `userID`  | string | ❌       | Optional user identifier for tracking  |

### Output Format

The Actor outputs comprehensive information about each BIN/IIN:

```json
{
    "bin": "456789",
    "reason": "",
    "isValid": true,
    "schemeName": "Visa",
    "schemeCoName": null,
    "isLuha": true,
    "isPrepaid": false,
    "isCommercial": false,
    "schemeType": "credit",
    "schemeBrand": "CLASSIC",
    "currency": "USD",
    "detectedDigits": "4",
    "syntaxGaps": [4, 8, 12],
    "syntaxLengths": [16, 18, 19],
    "syntaxCodeName": "CVV",
    "syntaxCodeSize": 3,
    "bankId": null,
    "bankIdentifier": "EXAMPLE_BANK",
    "bankName": "Example Bank",
    "bankCity": "New York",
    "bankUrl": "https://examplebank.com/",
    "bankPhone": "+1-555-123-4567",
    "bankLogo": "https://examplebank.com/logo.png",
    "bankLatitude": "40.7128",
    "bankLongitude": "-74.0060",
    "countryAlpha2": "US",
    "countryName": "United States",
    "countryCode": "+1",
    "countryNumeric": "840",
    "countryEmoji": "🇺🇸",
    "countryContinent": "North America",
    "countryLanguageCode": "en",
    "countryLanguageNative": "English",
    "timestamp": "2026-01-14T10:30:00.000Z"
}
```

#### Output Field Descriptions

**Basic Fields:**

- `bin`: The BIN/IIN that was analyzed
- `reason`: Human-readable explanation for validation result
- `isValid`: Boolean indicating if the BIN is valid and safe to use
- `timestamp`: ISO timestamp of when the analysis was performed

**Card Scheme Fields:**

- `schemeName`: Card scheme name (e.g., Visa, Mastercard)
- `schemeCoName`: Card company name
- `isLuha`: Whether card is issued by Luha
- `isPrepaid`: Whether card is prepaid
- `isCommercial`: Whether card is commercial
- `schemeType`: Card type (debit or credit)
- `schemeBrand`: Card brand level (Traditional, Gold, Platinum, etc.)
- `currency`: Card currency
- `detectedDigits`: Digits used to detect scheme details

**Card Syntax Fields:**

- `syntaxGaps`: Array showing card number formatting gaps
- `syntaxLengths`: Array of possible card number lengths
- `syntaxCodeName`: Security code name (e.g., CVV, CVC)
- `syntaxCodeSize`: Number of digits in the security code

**Bank Information Fields:**

- `bankId`: Bank identification number
- `bankIdentifier`: Bank identifier code
- `bankName`: Official bank name
- `bankCity`: City where bank headquarters are located
- `bankUrl`: Bank's official website
- `bankPhone`: Bank's contact phone number
- `bankLogo`: URL to bank's logo image
- `bankLatitude`: Geographic latitude of bank location
- `bankLongitude`: Geographic longitude of bank location

**Country Information Fields:**

- `countryAlpha2`: ISO 3166-1 alpha-2 country code
- `countryName`: Full country name
- `countryCode`: Country dialing code
- `countryNumeric`: ISO numeric country code
- `countryEmoji`: Country flag emoji
- `countryContinent`: Continent name
- `countryLanguageCode`: Primary language code
- `countryLanguageNative`: Native language name

### Use Cases

This Actor is perfect for:

- **Payment Fraud Detection**: Identify suspicious BINs and prevent fraudulent transactions
- **Geographic Mismatch Detection**: Flag transactions where user location doesn't match card issuer location
- **Card Verification**: Validate payment details during checkout processes
- **Multi-Account Detection**: Identify users attempting to create multiple accounts with the same BIN
- **Risk Assessment**: Evaluate transaction risk based on card issuer and type
- **Customer Experience**: Provide personalized services based on card brand and type
- **Compliance**: Ensure payment methods comply with regional restrictions

### BIN Formats Supported

The API accepts BIN/IIN in various formats:

- `456789` (Basic 6-digit BIN, recommended)
- `45678912` (8-digit BIN)
- `4567891234` (10-11 digit BIN)
- `456789XXXXXX1234` (BIN with masked middle digits)
- `4567891234567890` (Full card number - only first 6 digits used, but don't send full card numbers for security reasons)

**Note**: The IIN (Issuer Identification Number), also known as BIN (Bank Identification Number), consists of the first 6 digits of a debit or credit card number. These digits identify the issuing entity such as the bank or financial institution.

### Your feedback

We're always working on improving the performance of our Actors. If you have any technical feedback for BIN lookup or found a bug, please create an issue in the [Issues tab](https://apify.com/greip/bin-lookup/issues/open).

# Actor input Schema

## `bin` (type: `string`):

Bank Identification Number (first 6-8 digits of a card) to validate using Greip BIN Lookup API. Accepts formats like '517041' or longer BIN numbers.

## Actor input object example

```json
{
  "bin": "517041"
}
```

# Actor output Schema

## `binLookupResults` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "bin": "517041"
};

// Run the Actor and wait for it to finish
const run = await client.actor("greip/bin-lookup").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "bin": "517041" }

# Run the Actor and wait for it to finish
run = client.actor("greip/bin-lookup").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "bin": "517041"
}' |
apify call greip/bin-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,greip/bin-lookup"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MOhnTrzZ4iDQs2QSD/builds/8abrgd6DZgUqx0duf/openapi.json
