# Chinese Identifier Validation Toolkit (`prizable_aster/chinese-identifier-validation-toolkit`) Actor

Privacy-safe China ID card, USCC, bank card Luhn, mobile number, and postal code validation API with masked results.

- **URL**: https://apify.com/prizable\_aster/chinese-identifier-validation-toolkit.md
- **Developed by:** [Vaque Wei](https://apify.com/prizable_aster) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## Chinese ID Card, USCC and Bank Card Validator API

Validate and mask common mainland China identifiers in privacy-safe batches. This Actor works as a China ID card validator, Unified Social Credit Code (USCC) checker, bank card Luhn validator, mobile number format checker, and China postal code validator without calling external identity databases.

Use it for data-quality checks, CRM imports, onboarding pre-validation, form validation, compliance workflows, and ETL pipelines. It performs deterministic format and checksum validation only; a valid result does not prove that a person, company, account, or address exists.

### Quick start

Run the Actor with one or more records. Use your own `id` value to join each result back to the source record without exposing the raw identifier in the output.

```json
{
  "records": [
    {"id": "customer-1", "type": "residentId", "value": "11010519491231002X"},
    {"id": "company-1", "type": "socialCreditCode", "value": "YOUR_CODE"},
    {"id": "phone-1", "type": "auto", "value": "13800138000"},
    {"id": "postal-1", "type": "postalCode", "value": "100000"}
  ]
}
````

Up to 1,000 records can be validated in one run.

### Common use cases

- Pre-check Chinese identity card numbers before CRM or ERP imports.
- Validate Unified Social Credit Code structure and checksum for company records.
- Detect malformed mainland China mobile numbers and postal codes.
- Run Luhn checksum validation on bank card numbers before downstream processing.
- Mask sensitive identifiers while retaining machine-readable validation results.
- Add deterministic validation to n8n, Make, Zapier, API, and data pipeline workflows.

### Supported identifiers

- 18-character China resident ID card numbers under GB 11643-1999.
- 18-character Unified Social Credit Codes (USCC) under GB 32100-2015.
- Mainland China mobile phone number structure.
- Bank card number length and Luhn checksum.
- Six-digit mainland China postal code structure.
- Automatic type detection when the structure is distinctive.

### Privacy-first behavior

- Raw input values are processed in memory and are never copied into dataset items.
- Every output contains only a masked representation.
- The Actor does not log identifier values.
- No external verification, lookup, or identity database is contacted.
- Validation does not prove that a person, company, account, or address exists.

Only process identifiers when you have a lawful purpose and the required consent. Identity numbers and financial account information may be sensitive personal information.

### Output

- `status`: `valid` or `invalid`.
- `requestedType`: type supplied by the caller.
- `detectedType`: validator that was applied.
- `maskedValue`: privacy-safe representation.
- `isValid`: final deterministic result.
- `checks`: individual format, date, sequence, or checksum checks.
- `errorCodes`: stable machine-readable reasons for invalid results.
- `disclaimer`: reminder that format validation is not identity verification.

### Limitations

- Resident ID validation checks structure, birth date, sequence, and checksum. It does not query government records.
- Social Credit Code validation checks the permitted character set and checksum. It does not query the National Enterprise Credit Information Publicity System.
- Mobile prefixes change over time, so the Actor intentionally validates only the broad mainland mobile structure.
- A valid Luhn checksum does not prove that a bank card was issued or is active.

### Search terms

China ID validator, Chinese identity card checker, resident ID checksum, Unified Social Credit Code validator, USCC checker, bank card Luhn checker, mainland China mobile validator, China postal code validation, Chinese data validation API, 中国身份证号码校验, 统一社会信用代码校验, 银行卡 Luhn 校验.

# Actor input Schema

## `records` (type: `array`):

Identifiers to validate. Raw values are never copied to the output dataset.

## Actor input object example

```json
{
  "records": [
    {
      "id": "sample-id",
      "type": "residentId",
      "value": "11010519491231002X"
    },
    {
      "id": "sample-postal",
      "type": "postalCode",
      "value": "100000"
    }
  ]
}
```

# Actor output Schema

## `results` (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 = {
    "records": [
        {
            "id": "sample-id",
            "type": "residentId",
            "value": "11010519491231002X"
        },
        {
            "id": "sample-postal",
            "type": "postalCode",
            "value": "100000"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("prizable_aster/chinese-identifier-validation-toolkit").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 = { "records": [
        {
            "id": "sample-id",
            "type": "residentId",
            "value": "11010519491231002X",
        },
        {
            "id": "sample-postal",
            "type": "postalCode",
            "value": "100000",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("prizable_aster/chinese-identifier-validation-toolkit").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "records": [
    {
      "id": "sample-id",
      "type": "residentId",
      "value": "11010519491231002X"
    },
    {
      "id": "sample-postal",
      "type": "postalCode",
      "value": "100000"
    }
  ]
}' |
apify call prizable_aster/chinese-identifier-validation-toolkit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=prizable_aster/chinese-identifier-validation-toolkit",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Chinese Identifier Validation Toolkit",
        "description": "Privacy-safe China ID card, USCC, bank card Luhn, mobile number, and postal code validation API with masked results.",
        "version": "0.0",
        "x-build-id": "kv04bcKSAOvTRVRBz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/prizable_aster~chinese-identifier-validation-toolkit/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-prizable_aster-chinese-identifier-validation-toolkit",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/prizable_aster~chinese-identifier-validation-toolkit/runs": {
            "post": {
                "operationId": "runs-sync-prizable_aster-chinese-identifier-validation-toolkit",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/prizable_aster~chinese-identifier-validation-toolkit/run-sync": {
            "post": {
                "operationId": "run-sync-prizable_aster-chinese-identifier-validation-toolkit",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "records"
                ],
                "properties": {
                    "records": {
                        "title": "Identifiers",
                        "maxItems": 1000,
                        "type": "array",
                        "description": "Identifiers to validate. Raw values are never copied to the output dataset.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "title": "Record ID",
                                    "description": "Optional caller-defined identifier returned unchanged.",
                                    "type": "string"
                                },
                                "type": {
                                    "title": "Identifier type",
                                    "description": "Use auto to detect a likely identifier type from its structure.",
                                    "type": "string",
                                    "enum": [
                                        "auto",
                                        "residentId",
                                        "socialCreditCode",
                                        "mobilePhone",
                                        "bankCard",
                                        "postalCode"
                                    ]
                                },
                                "value": {
                                    "title": "Identifier value",
                                    "description": "Sensitive input used in memory for validation and omitted from output.",
                                    "type": "string"
                                }
                            },
                            "required": [
                                "value"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
