> For the complete documentation index, see [llms.txt](https://valify.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valify.gitbook.io/documentation/apis/egy-nid-ocr/egy-nid-ocr.md).

# API Response

<mark style="color:$primary;">**API Response**</mark>

* **Review Required:** This additional list will be sent with the API response. It contains a list of fields that have caused either the **front data validity** or **back data validity** to be classified as false.&#x20;

&#x20;      These are the fields that may be required to go through manual review due to OCR-related issues.&#x20;

```json
{
    "result": 
    {
        "first_name": '<string>',
        "full_name": '<string>',
        "street": '<string>',
        "front_nid": '<string>',
        "serial_number": '<string>',
        "back_nid":'<string>',
        "release_date": '<string>',
        "gender": '<string>',
        "marital_status": '<string>'
        "profession": '<string>',
        "religion":'<string>',
        "husband_name": '<string>',
        "date_of_birth": '<string>',
        "age":'<int>',
        "birth_governarate": '<string>',
        "police_station": '<string'>,
        "governorate": '<string>',
        "expiry_date": '<string>',
    },
    
     "advanced_confidence": 
    {
        'fraud_detection_zone': <int>,
          'fraud_detection_details': {
          'face_fraud_zone': <int>, 
          'face_fraud_confidence': <float>, 
          'front_image_manipulation_zone': <int>,
          'front_image_manipulation_confidence': <float>
          }
    },
  
   "document_verification_plus": 
   {
        "expired": '<boolean>',
        "front_data_validity": '<boolean>',
        "back_data_validity": '<boolean>',
        "is_front_greyscale": '<boolean>',
        "is_back_greyscale": '<boolean>',
        "review_required": '<list>'
    },
    
   "profession_analysis": 
   {
        "workplace": '<string>',
        "profession_categorization": '<string>'
    },
    
    "document_liveness":
    {
        "is_front_document_live": '<boolean>',
        "front_document_format": '<string>',
        "is_back_document_live": '<boolean>',
        "back_document_format": '<string>'
    },
    
    "transaction_id": '<string>',
    "trials_remaining": '<int>'
}
```

## Advanced confidence breakdown

**"fraud\_detection\_zone"** acts as a parent for "face\_fraud\_zone" and "front\_image\_manipulation\_zone". if either of them is yellow/red, the result is of this flag will be yellow/red.

* **"fraud\_detection\_zone"**: values "0" for green zone, "1" for yellow zone (needs review) and "2" for red zone. This value defines an overall fraud zone for the NID.
* **"face\_fraud\_zone":** Same values as "fraud\_detection\_zone" but for face manipulation specifically.
* **"'face\_fraud\_confidence":** float values from 0 to 1 indicating to what degree the face might be manipulated.
* **"front\_image\_manipulation\_zone":** Same values as "fraud\_detection\_zone" but generic for any manipulation in the NID.
* **"'front\_image\_confidence":** float values from 0 to 1 indicating to what degree the NID might be manipulated.

## Profession Analysis breakdown

This section breaks down the profession field as follows

* **"workplace":** This is the extraction of the workplace from the profession field. If the workplace does not exist, then this field is returned as empty
* **"profession\_categorization"**: The returns the category that this specific occupation pertains to. Please check the list below
  * Salaried
  * Unemployed
  * Self-employed
  * Student
  * Retired
  * Housewife
  * Freelancer
  * Public Official

## Document Verification Plus breakdown

*The following are possible values that could come in the review required list along with their triggers*

1. `date_of_birth` triggered by an invalid date or incorrect format
2. `street` when the field value is missing from the response
3. `police_station` when the field value is missing from the response
4. `governorate` when the field value is missing from the response
5. `birth_governorate` triggered by an invalid field format
6. `back_nid` triggered by an invalid field format
7. `front_nid` triggered by an invalid field format
8. `serial_number` triggered by an invalid field format
9. `full_name` triggered when the field value is missing from the response
10. `first_name` triggered when the field value is missing from the response
11. `expiry_date` triggered by an invalid date or incorrect format
12. `release_date` triggered by an invalid date or incorrect format&#x20;
13. `front_img` triggered when `is_front_greyscale` is true
14. `back_img` triggered when `is_back_greyscale` is true

## Document liveness breakdown

System detects document authenticity and returns a new flag called `is_front_document_live & is_back_document_live` under the `document_liveness` section where:<br>

* `"is_front_document_live"`: boolean value.
  * `true` → front NID side is a genuine physical document.
  * `false` → front NID side is not genuine (e.g., printed/photocopied).
* `"is_back_document_live"`: boolean value.
  * `true` → back NID side is a genuine physical document.
  * `false` → back NID side is not genuine (e.g., printed/photocopied).

When either `"is_front_document_live" = false` or `"is_back_document_live" = false`, the system provides additional format flags:

* `"front_document_format"`: value `"printed"` when the front NID is a printed/photocopied document.
* `"back_document_format"`: value `"printed"` when the back NID is a printed/photocopied document.

This flag can be disabled to turn off the NID liveness detection feature as a whole.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://valify.gitbook.io/documentation/apis/egy-nid-ocr/egy-nid-ocr.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
