Extract data from PAN Card
curl --request POST \
--url https://bgv.konnectnxt.com/api/v2/ocr/pan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_url": "https://example.com/documents/pan-sample.jpg"
}
'import requests
url = "https://bgv.konnectnxt.com/api/v2/ocr/pan"
payload = { "document_url": "https://example.com/documents/pan-sample.jpg" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_url: 'https://example.com/documents/pan-sample.jpg'})
};
fetch('https://bgv.konnectnxt.com/api/v2/ocr/pan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bgv.konnectnxt.com/api/v2/ocr/pan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document_url' => 'https://example.com/documents/pan-sample.jpg'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bgv.konnectnxt.com/api/v2/ocr/pan"
payload := strings.NewReader("{\n \"document_url\": \"https://example.com/documents/pan-sample.jpg\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://bgv.konnectnxt.com/api/v2/ocr/pan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_url\": \"https://example.com/documents/pan-sample.jpg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bgv.konnectnxt.com/api/v2/ocr/pan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_url\": \"https://example.com/documents/pan-sample.jpg\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"message": "Operation completed successfully",
"data": {
"pan_number": "MYWPS3665E",
"name": "Rajesh Kumar Sharma",
"father_name": "Rakesh Kumar Sharma",
"date_of_birth": "1990-03-15",
"date_of_issue": "",
"pan_type": "Individual",
"age": 35,
"is_minor": false,
"is_scanned": true
},
"credits_used": 10,
"credits_remaining": 984066.5
}
OCR APIs
PAN v2
Processes a PAN image and extracts structured information using OCR technology. Returns PAN number, name, father’s name, date of birth, and other details.
POST
/
v2
/
ocr
/
pan
Extract data from PAN Card
curl --request POST \
--url https://bgv.konnectnxt.com/api/v2/ocr/pan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_url": "https://example.com/documents/pan-sample.jpg"
}
'import requests
url = "https://bgv.konnectnxt.com/api/v2/ocr/pan"
payload = { "document_url": "https://example.com/documents/pan-sample.jpg" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_url: 'https://example.com/documents/pan-sample.jpg'})
};
fetch('https://bgv.konnectnxt.com/api/v2/ocr/pan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bgv.konnectnxt.com/api/v2/ocr/pan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document_url' => 'https://example.com/documents/pan-sample.jpg'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bgv.konnectnxt.com/api/v2/ocr/pan"
payload := strings.NewReader("{\n \"document_url\": \"https://example.com/documents/pan-sample.jpg\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://bgv.konnectnxt.com/api/v2/ocr/pan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_url\": \"https://example.com/documents/pan-sample.jpg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bgv.konnectnxt.com/api/v2/ocr/pan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_url\": \"https://example.com/documents/pan-sample.jpg\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"message": "Operation completed successfully",
"data": {
"pan_number": "MYWPS3665E",
"name": "Rajesh Kumar Sharma",
"father_name": "Rakesh Kumar Sharma",
"date_of_birth": "1990-03-15",
"date_of_issue": "",
"pan_type": "Individual",
"age": 35,
"is_minor": false,
"is_scanned": true
},
"credits_used": 10,
"credits_remaining": 984066.5
}
Description
Extract structured data from PAN cards using advanced OCR technology powered by IDfy. Simply provide the document URL and receive comprehensive details including PAN number, name, father’s name, date of birth, PAN type, and age information. The API automatically detects whether the document is scanned or photographed and validates minor status.Use Cases
This API is valuable for:- Digital KYC Onboarding - Automate customer verification by extracting PAN details during account opening or registration processes
- Loan Applications - Quickly capture applicant PAN information for identity verification and credit assessment
- Tax Compliance - Extract PAN details for tax filing and compliance requirements without manual data entry
- Identity Authentication - Verify individual identity by extracting name, father’s name, and date of birth from PAN uploads
- Document Validation - Detect whether the PAN card is scanned or photographed to assess document quality
- Age Verification - Automatically calculate age and determine minor status for age-restricted services
- Customer Onboarding - Eliminate manual data entry by automatically capturing all PAN fields from uploaded documents
Authorizations
API key issued by KonnectNXT. Pass as Authorization: Bearer <your_api_key>.
Body
application/json
Public URL of the PAN card image (JPG, PNG, or PDF)
Example:
"https://example.com/documents/pan-sample.jpg"
Response
PAN OCR processed successfully
Overall status of the API
Available options:
success, error HTTP status code
Example:
400
Description of the response or error
Example:
"Invalid request parameters"
Show child attributes
Show child attributes
Represents the total number of credits used in this request.
Example:
3
Represents the remaining credits available for use.
Example:
4040
Was this page helpful?

