CNP Generator API

Documentation, code examples, and live testing for CNP generation with optional parameters.

← Back to the API overview

POST
The only required field is limit. Generate with just the desired count, or add any or all filters. The limit is 10 requests/minute per IP address.

Parameters

FieldTypeRequiredDescription
limitintegerYesNumber of returned CNP values, minimum 1.
sstring/integerNoS digit from 1 to 9.
birth_datestringNoDate in YYYY-MM-DD format.
countystringNoValid county/region code.
serialintegerNoInitial number from 1 to 999.
modestringNosequential or random.
langstringNoro by default or en.

Download regions and options (JSON)

Integration examples

Request
POST
curl -X POST 'https://verificarecnp.ro/api/v1/cnp/generate' \
  -H 'Content-Type: application/json' \
  -d '{"limit":2,"s":"1","birth_date":"1996-05-27","county":"40","serial":7,"mode":"sequential","lang":"en"}'
<?php

$payload = array (
  'limit' => 2,
  's' => '1',
  'birth_date' => '1996-05-27',
  'county' => '40',
  'serial' => 7,
  'mode' => 'sequential',
  'lang' => 'en',
);
$ch = curl_init('https://verificarecnp.ro/api/v1/cnp/generate');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
const response = await fetch('https://verificarecnp.ro/api/v1/cnp/generate', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "limit": 2,
    "s": "1",
    "birth_date": "1996-05-27",
    "county": "40",
    "serial": 7,
    "mode": "sequential",
    "lang": "en"
})
});
const result = await response.json();
import json
import urllib.request

payload = json.dumps({
    "limit": 2,
    "s": "1",
    "birth_date": "1996-05-27",
    "county": "40",
    "serial": 7,
    "mode": "sequential",
    "lang": "en"
}).encode()
request = urllib.request.Request(
    'https://verificarecnp.ro/api/v1/cnp/generate', data=payload,
    headers={'Content-Type': 'application/json'}, method='POST'
)
result = json.load(urllib.request.urlopen(request))
Live response
Ready
Press “Run test” to see the response.

JSON response example

JSON
{
    "success": true,
    "lang": "en",
    "count": 2,
    "items": [
        {
            "cnp": "1960527400072",
            "s": "1",
            "person_type": "Male, born 1900-1999",
            "gender": "Male",
            "gender_key": "male",
            "birth_date": "1996-05-27",
            "week_day": "Monday",
            "week_day_key": 1,
            "age": 30,
            "zodiac": "Gemini",
            "zodiac_key": "gemini",
            "county_code": "40",
            "county": "București",
            "serial": "007",
            "control_digit": "2",
            "expected_digit": "2"
        },
        {
            "cnp": "1960527400080",
            "s": "1",
            "person_type": "Male, born 1900-1999",
            "gender": "Male",
            "gender_key": "male",
            "birth_date": "1996-05-27",
            "week_day": "Monday",
            "week_day_key": 1,
            "age": 30,
            "zodiac": "Gemini",
            "zodiac_key": "gemini",
            "county_code": "40",
            "county": "București",
            "serial": "008",
            "control_digit": "0",
            "expected_digit": "0"
        }
    ]
}

Error responses

Every error is returned as JSON with the corresponding HTTP status.

Status Meaning
400 Bad RequestMalformed or invalid JSON body.
415 Unsupported Media TypeContent-Type is not application/json.
422 Unprocessable ContentOne or more request fields failed validation.
429 Too Many RequestsRate limit exceeded (10 requests/minute).