CPF Generator API Documentation
CPF Generator (cpfgenerator.org ) provides high-performance, reliable Brazilian tax number generation services, including CPF (Individual Taxpayer Number) and CNPJ (Company Taxpayer Number) generation APIs.
Accuracy : Strictly follows the validation algorithm of Brazilian Federal Revenue Service
Easy Integration : Provides integration examples for mainstream programming languages
Free to Use : No registration required, direct API access
Protocol : HTTPS
Method : POST
Data Format : JSON
Character Encoding : UTF-8
Base URL : https://cpfgenerator.org/api
API Version : v1
1.1.1 Interface Description
Generate valid Brazilian Individual Taxpayer Numbers (CPF).
Endpoint : /cpf/generator
Method : POST
Content-Type : application/json
Parameter
Type
Required
Default
Description
quant
integer
No
1
Number of CPFs to generate (1-100)
format
boolean
No
true
Whether to format the numbers
{
"quant" : 2 ,
"format" : true
}
1.1.3 Response Parameters
Parameter
Type
Required
Description
success
boolean
Yes
Whether the request was successful
data
array
No
List of generated numbers
count
integer
No
Number of generated numbers
error
string
No
Error type
message
string
No
Error message
{
"success" : true ,
"data" : [
" 123.456.789-09" ,
" 987.654.321-00"
],
"count" : 2
}
{
"success" : false ,
"error" : " Invalid request format" ,
"message" : " Parameter \" quant\" must be between 1 and 100"
}
curl --location --request POST ' https://cpfgenerator.org/api/cpf/generator' --header ' Content-Type: application/json' --data-raw ' {
"quant": 2,
"format": true
}'
1.2.1 Interface Description
Validate Brazilian Individual Taxpayer Numbers (CPF).
Endpoint : /cpf/validator
Method : POST
Content-Type : application/json
Parameter
Type
Required
Description
values
string
Yes
CPF numbers to validate (comma-separated)
format
boolean
No
Whether to format the response numbers
{
"values" : " 319.982.747-05,41950456900" ,
"format" : true
}
1.2.3 Response Parameters
Parameter
Type
Required
Description
success
boolean
Yes
Whether the request was successful
data
object
No
Response data object
error
string
No
Error type
message
string
No
Error message
{
"success" : true ,
"data" : {
"results" : [
{
"cpf" : " 319.982.747-05" ,
"isValid" : true
},
{
"cpf" : " 419.504.569-00" ,
"isValid" : true
}
],
"summary" : {
"total" : 2 ,
"valid" : 2 ,
"invalid" : 0
}
}
}
{
"success" : false ,
"error" : " Invalid request format" ,
"message" : " Parameter \" quant\" must be between 1 and 100"
}
curl --location --request POST ' https://cpfgenerator.org/api/cpf/validator' --header ' Content-Type: application/json' --data-raw ' {
"values": "319.982.747-05,41950456900",
"format": true
}'
2.1.1 Interface Description
Generate valid Brazilian Company Taxpayer Numbers (CNPJ).
Endpoint : /cnpj/generator
Method : POST
Content-Type : application/json
Parameter
Type
Required
Default
Description
quant
integer
No
1
Number of CNPJs to generate (1-100)
format
boolean
No
true
Whether to format the numbers
{
"quant" : 2 ,
"format" : true
}
2.1.3 Response Parameters
Parameter
Type
Required
Description
success
boolean
Yes
Whether the request was successful
data
array
No
List of generated numbers
count
integer
No
Number of generated numbers
error
string
No
Error type
message
string
No
Error message
{
"success" : true ,
"data" : [
" 19.909.725/2666-64" ,
" 56.624.829/3453-62"
],
"count" : 2
}
{
"success" : false ,
"error" : " Invalid parameters" ,
"message" : " Parameter \" quant\" must be between 1 and 100"
}
curl --location --request POST ' https://cpfgenerator.org/api/cnpj/generator' --header ' Content-Type: application/json' --data-raw ' {
"quant": 2,
"format": true
}'
2.2.1 Interface Description
Validate Brazilian Company Taxpayer Numbers (CNPJ).
Endpoint : /cnpj/validator
Method : POST
Content-Type : application/json
Parameter
Type
Required
Description
values
string
Yes
CNPJ numbers to validate (comma-separated)
format
boolean
No
Whether to format the response numbers
{
"values" : " 95.811.069/0676-05,68804717558953" ,
"format" : true
}
2.2.3 Response Parameters
Parameter
Type
Required
Description
success
boolean
Yes
Whether the request was successful
data
object
No
Response data object
error
string
No
Error type
message
string
No
Error message
{
"success" : true ,
"data" : {
"results" : [
{
"cnpj" : " 95.811.069/0676-05" ,
"isValid" : true
},
{
"cnpj" : " 68.804.717/5589-53" ,
"isValid" : true
}
],
"summary" : {
"total" : 2 ,
"valid" : 2 ,
"invalid" : 0
}
}
}
{
"success" : false ,
"error" : " Invalid parameters" ,
"message" : " Parameter \" format\" must be a boolean"
}
curl --location --request POST ' https://cpfgenerator.org/api/cnpj/validator' --header ' Content-Type: application/json' --data-raw ' {
"values": "93.387.167/7658-35,48.599.817/3114-00",
"format": true
}'
Use the quant
parameter for batch generation to avoid multiple requests
Set reasonable request timeout values
Implement retry mechanism, recommended maximum 3 retries
Control concurrent requests reasonably during peak periods