API Reference

SA ID Validation API

Integrate structural ID number validation into your applications with our simple REST API. Check format, date, and Luhn checksum, and decode the date of birth, age, gender, and citizenship from the number itself.

Quick Start

Get started with the SA ID Checker API in minutes. Here's a simple example to validate an ID number:

cURL
curl -X POST https://www.saidchecker.co.za/api/validate \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"idNumber": "8501015009086"}'

Response:

{
  "success": true,
  "data": {
    "isValid": true,
    "idNumber": "8501015009086",
    "errors": [],
    "details": {
      "dateOfBirth": "15 January 1985",
      "age": 40,
      "gender": "Male",
      "citizenship": "SA Citizen"
    }
  }
}

Authentication

All API requests require authentication using an API key. Include your key in the X-API-Key header:

X-API-Key: YOUR_API_KEY

Keep your API key secret! Never expose it in client-side code or public repositories.

Getting an API Key

  1. Sign up for a Business plan
  2. Go to Dashboard → API Keys
  3. Click "Create New Key"
  4. Copy your key (it won't be shown again)

Validate ID Number

POST/api/validate

Validates the structure of a single South African ID number — its format, date, and Luhn checksum — and returns the date of birth, age, gender, and citizenship decoded from the number itself. It does not check the number against Home Affairs or verify a person's real-world identity.

Request Body

ParameterTypeRequiredDescription
idNumberstringYes13-digit SA ID number. Dashes and whitespace are automatically stripped.
includeBreakdownbooleanNoInclude digit breakdown (default: false)

Response

{
  "success": true,
  "data": {
    "isValid": boolean,
    "idNumber": string,
    "errors": string[],
    "details": {
      "dateOfBirth": string | null,
      "age": number | null,
      "gender": "Male" | "Female" | null,
      "citizenship": "SA Citizen" | "Permanent Resident" | null
    } | null,
    "breakdown": {  // Only if includeBreakdown: true
      "birthDate": string,
      "genderSequence": string,
      "citizenship": string,
      "checksum": string
    } | null
  }
}

Bulk Validation

POST/api/validate/bulk

Validate multiple ID numbers in a single request (up to 1000 per request).

curl -X POST https://www.saidchecker.co.za/api/validate/bulk \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "idNumbers": [
      "8501015009086",
      "9001015800088",
      "7505115111081"
    ]
  }'

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

CodeMeaning
200Success
400Bad request (invalid parameters)
401Unauthorized (invalid API key)
429Rate limit exceeded
500Server error

Rate Limits

API rate limits depend on your plan:

PlanRequests/minuteRequests/month
Business100Unlimited
EnterpriseCustomUnlimited

Code Examples

JavaScript / Node.js

const response = await fetch('https://www.saidchecker.co.za/api/validate', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ idNumber: '8501015009086' })
});

const data = await response.json();
console.log(data);

Python

import requests

response = requests.post(
    'https://www.saidchecker.co.za/api/validate',
    headers={
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={'idNumber': '8501015009086'}
)

print(response.json())

PHP

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://www.saidchecker.co.za/api/validate',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: YOUR_API_KEY',
        'Content-Type: application/json'
    ],
    CURLOPT_POSTFIELDS => json_encode(['idNumber' => '8501015009086'])
]);

$response = curl_exec($curl);
curl_close($curl);

print_r(json_decode($response, true));

Ready to Integrate?

Get API access with a Business plan

Get API Access