{
	"info": {
		"_postman_id": "passport-ocr-api",
		"name": "Passport OCR API",
		"description": "Extract structured passport data from MRZ images with a single API call.\n\nBase URL: https://passport-ocr.com\n\nFree tier: 10 requests/day, no signup required.\nPaid tier: $0.01/request with priority processing.\n\nDocumentation: https://passport-ocr.com/docs",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{
			"key": "baseUrl",
			"value": "https://passport-ocr.com",
			"type": "string"
		},
		{
			"key": "apiKey",
			"value": "passport_ocr_your_key_here",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "OCR",
			"item": [
				{
					"name": "Extract MRZ (File Upload)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{apiKey}}",
								"description": "Optional — omit for anonymous free-tier usage",
								"disabled": true
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "image",
									"type": "file",
									"src": "",
									"description": "Passport image (JPEG, PNG, WebP — max 10 MB)"
								}
							]
						},
						"url": {
							"raw": "{{baseUrl}}/v1/ocr",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "ocr"]
						},
						"description": "Upload a passport image as multipart form data and receive structured MRZ data.\n\nNo API key required for up to 10 free requests per day."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"url": {
									"raw": "{{baseUrl}}/v1/ocr",
									"host": ["{{baseUrl}}"],
									"path": ["v1", "ocr"]
								}
							},
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n  \"success\": true,\n  \"data\": {\n    \"documentType\": \"PASSPORT\",\n    \"documentNumber\": \"L898902C3\",\n    \"issuingCountry\": \"UTO\",\n    \"lastName\": \"ERIKSSON\",\n    \"firstName\": \"ANNA MARIA\",\n    \"nationality\": \"UTO\",\n    \"dateOfBirth\": \"1974-08-12\",\n    \"sex\": \"female\",\n    \"expirationDate\": \"2012-04-15\",\n    \"personalNumber\": \"ZE184226B\"\n  }\n}"
						},
						{
							"name": "MRZ Not Detected",
							"originalRequest": {
								"method": "POST",
								"url": {
									"raw": "{{baseUrl}}/v1/ocr",
									"host": ["{{baseUrl}}"],
									"path": ["v1", "ocr"]
								}
							},
							"status": "Unprocessable Entity",
							"code": 422,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"MRZ_NOT_DETECTED\",\n    \"message\": \"Could not detect an MRZ region in the uploaded image.\"\n  }\n}"
						}
					]
				},
				{
					"name": "Extract MRZ (Base64)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{apiKey}}",
								"description": "Optional — omit for anonymous free-tier usage",
								"disabled": true
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"image\": \"data:image/jpeg;base64,/9j/4AAQ...\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/v1/ocr",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "ocr"]
						},
						"description": "Send a passport image as a base64 data URI in a JSON body.\n\nNo API key required for up to 10 free requests per day."
					},
					"response": []
				},
				{
					"name": "Extract MRZ (Dry Run)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Dry-Run",
								"value": "true",
								"description": "Validate image and detect MRZ without full OCR — free, no credit deducted"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "image",
									"type": "file",
									"src": "",
									"description": "Passport image (JPEG, PNG, WebP — max 10 MB)"
								}
							]
						},
						"url": {
							"raw": "{{baseUrl}}/v1/ocr",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "ocr"]
						},
						"description": "Validate an image and detect the MRZ region without performing full OCR. This is free and does not deduct any credits."
					},
					"response": []
				},
				{
					"name": "Extract MRZ (With Idempotency Key)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{apiKey}}"
							},
							{
								"key": "Idempotency-Key",
								"value": "{{$guid}}",
								"description": "Client-generated UUID — cached response for 24h (paid only)"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "image",
									"type": "file",
									"src": "",
									"description": "Passport image (JPEG, PNG, WebP — max 10 MB)"
								}
							]
						},
						"url": {
							"raw": "{{baseUrl}}/v1/ocr",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "ocr"]
						},
						"description": "Send an OCR request with an idempotency key to safely retry without double-charging. Requires an API key (paid requests only). Cached for 24 hours."
					},
					"response": []
				}
			],
			"description": "Core OCR endpoint for extracting MRZ data from passport images."
		},
		{
			"name": "Account",
			"item": [
				{
					"name": "Check Credit Balance",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{apiKey}}"
							}
						],
						"url": {
							"raw": "{{baseUrl}}/v1/credits",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "credits"]
						},
						"description": "Check your current credit balance. Requires an API key."
					},
					"response": []
				},
				{
					"name": "Check Anonymous Usage",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/v1/usage",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "usage"]
						},
						"description": "Check your anonymous usage count for today (based on fingerprint). No authentication required."
					},
					"response": []
				}
			],
			"description": "Account and usage management endpoints."
		},
		{
			"name": "System",
			"item": [
				{
					"name": "Health Check",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/v1/health",
							"host": ["{{baseUrl}}"],
							"path": ["v1", "health"]
						},
						"description": "Health check endpoint. Returns server status and version info."
					},
					"response": []
				}
			],
			"description": "System status endpoints."
		}
	]
}