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
| Field | Type | Required | Description |
|---|---|---|---|
limit | integer | Yes | Number of returned CNP values, minimum 1. |
s | string/integer | No | S digit from 1 to 9. |
birth_date | string | No | Date in YYYY-MM-DD format. |
county | string | No | Valid county/region code. |
serial | integer | No | Initial number from 1 to 999. |
mode | string | No | sequential or random. |
lang | string | No | ro 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
{
"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 Request | Malformed or invalid JSON body. |
415 Unsupported Media Type | Content-Type is not application/json. |
422 Unprocessable Content | One or more request fields failed validation. |
429 Too Many Requests | Rate limit exceeded (10 requests/minute). |