### Get Presigned S3 Upload URL (Python) Source: https://docs.vaarhaft.com/openapi/fraudscanner Obtains a presigned S3 PUT URL for uploading ZIP files larger than 10 MB. The URL is valid for 10 minutes. After uploading, the returned 's3_key' must be passed to the /v2/fraudscanner endpoint. ```python import requests API_URL = "https://api.vaarhaft.com" HEADERS = {"x-api-key": "YOUR_KEY", "caseNumber": "Case-123"} # Step 1: Get presigned URL url_resp = requests.post( f"{API_URL}/v2/getUploadUrl", headers=HEADERS ) upload_url = url_resp.json()["upload_url"] s3_key = url_resp.json()["s3_key"] # Step 2: Upload ZIP to S3 (example with a file object) zip_path = "large_file.zip" with open(zip_path, "rb") as f: requests.put( upload_url, data=f, headers={"Content-Type": "application/zip"}, ) # Step 3: Trigger analysis resp = requests.post( f"{API_URL}/v2/fraudscanner", params={"s3_key": s3_key}, headers=HEADERS, ) result = resp.json() ``` -------------------------------- ### GET /websites/vaarhaft/attachments Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= Retrieves attachments associated with the Vaarhaft website, categorized into various types such as heatmaps, analysis reports, and more. Attachments are provided as base64 encoded strings. ```APIDOC ## GET /websites/vaarhaft/attachments ### Description Retrieves attachments associated with the Vaarhaft website. Attachments are base64 encoded strings of raw files and are categorized. This endpoint is relevant for pure JSON responses and depends on the 'Accept'-header. ### Method GET ### Endpoint /websites/vaarhaft/attachments ### Query Parameters - **Accept** (string) - Optional - Specifies the desired response format. For JSON, use `application/json`. ### Response #### Success Response (200) - **analysis_report** (array) - List of attachment objects for analysis reports (PDF files). - **heatmaps** (array) - List of attachment objects for heatmaps (PNG files). - **thumbnails** (array) - List of attachment objects for thumbnails (PNG files). - **reverse_search_downloads** (array) - List of attachment objects for reverse search downloads (various formats). - **pdf_versions** (array) - List of attachment objects for PDF versions (PDF files). Each attachment object contains: - **filename** (string) - The name of the attachment file. - **mime_type** (string) - The MIME type of the attachment. - **data_b64** (string) - The base64 encoded data of the attachment. #### Response Example ```json { "analysis_report": [ { "filename": "[ANALYSIS-REPORT]-90211b82-a602-48b5-9cdf-2f189abbe7e7.pdf", "mime_type": "application/pdf", "data_b64": "..." } ], "heatmaps": [ { "filename": "[HEATMAP]-3a35b619-4157-48cc-8e9a-443bd55f1edc.png", "mime_type": "image/png", "data_b64": "..." }, { "filename": "[HEATMAP]-71bcd34e-025b-4efa-93f7-fac9f754c02c.png", "mime_type": "image/png", "data_b64": "..." } ] } ``` #### Error Response (4xx/5xx) - **detail** (string) - Details about why the request was not successful. ``` -------------------------------- ### POST /v2/getUploadUrl - Get Presigned S3 Upload URL Source: https://docs.vaarhaft.com/openapi.md Obtains a presigned S3 PUT URL for uploading large ZIP files that exceed the 10 MB direct upload limit. The URL is valid for 10 minutes. ```APIDOC ## POST /v2/getUploadUrl ### Description Returns a presigned S3 PUT URL and an associated S3 key for uploading ZIP files that are larger than the 10 MB direct upload limit. This URL is valid for 10 minutes. After uploading the file to the provided URL, the `s3_key` should be passed to the `POST /v2/fraudscanner` endpoint. ### Method POST ### Endpoint `/v2/getUploadUrl` ### Parameters *No parameters are required for this endpoint.* ### Request Example ```json { "message": "Request for upload URL" } ``` ### Response #### Success Response (200) - **upload_url** (string) - The presigned S3 PUT URL to upload the ZIP file to. - **s3_key** (string) - The key that identifies the uploaded file in S3, to be used with `POST /v2/fraudscanner`. #### Response Example ```json { "upload_url": "https://vaarhaft-uploads.s3.amazonaws.com/...?AWSAccessKeyId=...", "s3_key": "uploads/user123/case456/images.zip" } ``` ``` -------------------------------- ### Upload ZIP for Fraud Analysis (Python) Source: https://docs.vaarhaft.com/openapi/fraudscanner Analyzes image and document files for fraud indicators by uploading a ZIP file. Supports direct upload for files under 10 MB and a presigned S3 upload flow for larger files. Requires the 'requests' library. ```python import requests import os API_URL = "https://api.vaarhaft.com" HEADERS = {"x-api-key": "YOUR_KEY", "caseNumber": "Case-123"} THRESHOLD = 9 1024 1024 # 9 MB safety margin zip_path = "images.zip"zip_size = os.path.getsize(zip_path) if zip_size < THRESHOLD: # --- Direct upload (small files) --- with open(zip_path, "rb") as f: resp = requests.post( f"{API_URL}/v2/fraudscanner", files={"file": (zip_path, f, "application/zip")}, headers=HEADERS, ) else: # --- Presigned S3 upload (large files) --- # Step 1: Get presigned URL url_resp = requests.post( f"{API_URL}/v2/getUploadUrl", headers=HEADERS ) upload_url = url_resp.json()["upload_url"] s3_key = url_resp.json()["s3_key"] # Step 2: Upload ZIP to S3 with open(zip_path, "rb") as f: requests.put( upload_url, data=f, headers={"Content-Type": "application/zip"}, ) # Step 3: Trigger analysis resp = requests.post( f"{API_URL}/v2/fraudscanner", params={"s3_key": s3_key}, headers=HEADERS, ) result = resp.json() ``` -------------------------------- ### Python: Upload ZIP file for fraud analysis (VAARHAFT API) Source: https://docs.vaarhaft.com/openapi.md Demonstrates how to upload a ZIP file for fraud analysis using the VAARHAFT API with Python's requests library. It handles both direct uploads for files under 10 MB and presigned S3 uploads for larger files by first obtaining an upload URL and then triggering the analysis. ```python import requests import os API_URL = "https://api.vaarhaft.com" HEADERS = {"x-api-key": "YOUR_KEY", "caseNumber": "Case-123"} THRESHOLD = 9 1024 1024 # 9 MB safety margin zip_path = "images.zip"zip_size = os.path.getsize(zip_path) if zip_size < THRESHOLD: # --- Direct upload (small files) --- with open(zip_path, "rb") as f: resp = requests.post( f"{API_URL}/v2/fraudscanner", files={"file": (zip_path, f, "application/zip")}, headers=HEADERS, ) else: # --- Presigned S3 upload (large files) --- # Step 1: Get presigned URL url_resp = requests.post( f"{API_URL}/v2/getUploadUrl", headers=HEADERS ) upload_url = url_resp.json()["upload_url"] s3_key = url_resp.json()["s3_key"] # Step 2: Upload ZIP to S3 with open(zip_path, "rb") as f: requests.put( upload_url, data=f, headers={"Content-Type": "application/zip"}, ) # Step 3: Trigger analysis resp = requests.post( f"{API_URL}/v2/fraudscanner", params={"s3_key": s3_key}, headers=HEADERS, ) result = resp.json() print(result) ``` -------------------------------- ### POST /v2/getUploadUrl Source: https://docs.vaarhaft.com/openapi/fraudscanner Returns a presigned S3 PUT URL for uploading ZIP files that exceed the 10 MB direct upload limit. The URL is valid for 10 minutes. ```APIDOC ## POST /v2/getUploadUrl ### Description Returns a presigned S3 PUT URL for uploading ZIP files that exceed the 10 MB direct upload limit. The URL is valid for 10 minutes. After uploading to S3, pass the returned s3_key to POST /v2/fraudscanner. ### Method POST ### Endpoint /v2/getUploadUrl ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed." } ``` ### Response #### Success Response (200) - **upload_url** (string) - The presigned S3 PUT URL. - **s3_key** (string) - The key to be used when calling POST /v2/fraudscanner. #### Response Example ```json { "example": "{\"upload_url\": \"https://your-s3-bucket.s3.amazonaws.com/path/to/file.zip?AWSAccessKeyId=... ", \"s3_key\": \"path/to/file.zip\"}" } ``` ### Notes - The uploaded file is automatically deleted after processing or after 24h if not consumed. ``` -------------------------------- ### POST /v2/getUploadUrl Source: https://docs.vaarhaft.com/openapi/fraudscanner/getuploadurl Obtain a presigned S3 upload URL for large files that exceed the direct upload limit. This URL is valid for 10 minutes and is used to upload ZIP files before initiating a fraud scan. ```APIDOC ## POST /v2/getUploadUrl ### Description Returns a presigned S3 PUT URL for uploading ZIP files that exceed the 10 MB direct upload limit. The URL is valid for 10 minutes. After uploading to S3, pass the returned s3_key to POST /v2/fraudscanner. ### Method POST ### Endpoint /v2/getUploadUrl ### Parameters #### Header Parameters - **x-api-key** (string, required) - The API key for authentication. ### Request Example (No request body is specified for this endpoint) ### Response #### Success Response (200) - **upload_url** (string, required) - Presigned S3 PUT URL. Upload your ZIP file here using an HTTP PUT request with Content-Type application/zip. Expires after 10 minutes. - **s3_key** (string, required) - The S3 key to pass as query parameter to POST /v2/fraudscanner after uploading. #### Response Example (200) ```json { "upload_url": "https://s3.eu-central-1.amazonaws.com/vh-fs-large-uploads-prod/uploads/company123/a1b2c3d4.zip?...", "s3_key": "uploads/company123/a1b2c3d4.zip" } ``` #### Error Response (429) - **detail** (string) - Details about why the request was not successful. #### Response Example (429) ```json { "detail": "Some error details." } ``` ``` -------------------------------- ### POST /v2/fraudscanner Source: https://docs.vaarhaft.com/openapi/fraudscanner Analyze image and document files for fraud indicators. Supports direct upload for files < 10 MB or via S3 presigned URL for files between 10-50 MB. ```APIDOC ## POST /v2/fraudscanner ### Description Analyze image and document files for fraud indicators. Supports direct upload for files under 10 MB or via S3 presigned URL for files between 10-50 MB. ### Method POST ### Endpoint /v2/fraudscanner ### Parameters #### Query Parameters - **s3_key** (string) - Optional - The S3 key obtained from POST /v2/getUploadUrl for large file uploads. #### Request Body - **file** (file) - Required - The ZIP file to be analyzed. Use `multipart/form-data` for direct uploads. ### Request Example ```json { "example": "For files < 10MB, send as multipart/form-data with 'file' field. For files 10-50MB, use 's3_key' query parameter after uploading to S3 via POST /v2/getUploadUrl." } ``` ### Response #### Success Response (200) - **result** (object) - Contains the analysis results. #### Response Example ```json { "example": "{\"analysis_id\": \"abc123xyz\", \"status\": \"completed\", \"findings\": [...]}" } ``` ### Notes - Request timeout is 120s due to compute-heavy analysis. ``` -------------------------------- ### Website Metadata and C2PA Analysis Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= This section describes the API endpoints related to retrieving metadata and performing C2PA analysis for website content. ```APIDOC ## GET /websites/vaarhaft ### Description Retrieves metadata and C2PA analysis results for a given website. ### Method GET ### Endpoint /websites/vaarhaft ### Query Parameters - **url** (string) - Required - The URL of the website to analyze. ### Response #### Success Response (200) - **metadata** (object) - Raw metadata containing detailed information. - **Rating** (object) - Rating of the image metadata. - **Dates** (object) - Contains date entries from the metadata. - **Other** (array) - Other metadata found during analysis. - **error** (boolean) - Indicates if an error occurred during metadata analysis. - **enabled** (boolean) - Indicates if metadata analysis was enabled. - **c2pa** (object) - Results of the C2PA metadata / Content Credentials analysis. - **c2pa_extracted** (boolean) - Indicates if C2PA data was extracted. - **reason** (string) - Explanation for why C2PA data was extracted / not extracted. - **data** (object | null) - Detailed information regarding the extracted C2PA data. If no data was extracted, this will be null. - **is_valid** (boolean) - Indicates if the C2PA data is valid. - **suspicious_keywords** (array) - Keywords that may indicate tampering. - **validation_status_base64** (string) - Base64 encoded validation status. - **manifest_base64** (string) - Base64 encoded manifest of the C2PA data. - **error** (boolean) - Indicates if an error occurred during C2PA analysis. - **enabled** (boolean) - Indicates if C2PA analysis was enabled. - **generatedDetection** (object) - Detects if the image was generated by an AI. - **predictedClassName** (string) - Predicted class name ("gen" for generated or "real" for non-generated). - **confidence** (number) - Confidence level of the prediction. - **error** (boolean) - Indicates if an error occurred during generated detection. #### Response Example ```json { "metadata": { "Rating": {}, "Dates": {}, "Other": [], "error": false, "enabled": true }, "c2pa": { "c2pa_extracted": true, "reason": "C2PA data found", "data": { "is_valid": true, "suspicious_keywords": [], "validation_status_base64": "...", "manifest_base64": "..." }, "error": false, "enabled": true }, "generatedDetection": { "predictedClassName": "real", "confidence": 0.99, "error": false } } ``` ``` -------------------------------- ### POST /v2/getUploadUrl Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= Obtain a presigned S3 upload URL for large files that exceed the 10 MB direct upload limit. This URL is valid for 10 minutes. After uploading, use the provided s3_key with the /v2/fraudscanner endpoint. ```APIDOC ## POST /v2/getUploadUrl ### Description Get a presigned S3 upload URL for large files. Returns a presigned S3 PUT URL for uploading ZIP files that exceed the 10 MB direct upload limit. The URL is valid for **10 minutes**. After uploading to S3, pass the returned `s3_key` to `POST /v2/fraudscanner`. **Flow:** 1. `POST /v2/getUploadUrl` → receive `upload_url` + `s3_key` 2. `PUT` your ZIP to `upload_url` (with `Content-Type: application/zip`) 3. `POST /v2/fraudscanner?s3_key=` → receive analysis results The uploaded file is automatically deleted after processing (or after 24h if not consumed). ### Method POST ### Endpoint /v2/getUploadUrl ### Parameters #### Header Parameters - **x-api-key** (string) - Required - The API key for authentication. ### Request Example ```json { "example": "No request body needed for this endpoint." } ``` ### Response #### Success Response (200) - **upload_url** (string) - Presigned S3 PUT URL. Upload your ZIP file here using an HTTP PUT request with Content-Type application/zip. Expires after 10 minutes. - **s3_key** (string) - The S3 key to pass as query parameter to POST /v2/fraudscanner after uploading. #### Response Example ```json { "upload_url": "https://s3.eu-central-1.amazonaws.com/vh-fs-large-uploads-prod/uploads/company123/a1b2c3d4.zip?...", "s3_key": "uploads/company123/a1b2c3d4.zip" } ``` #### Error Responses - **429** - Allocated API quota has been reached / out of credits. - **500** - Internal server error. Something went wrong on the server while processing the request. - **501** - Configuration issue. ``` -------------------------------- ### File Analysis API Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= This endpoint allows for the analysis of uploaded files. It returns a detailed report including suspicion levels, AI model versions used, and case information. ```APIDOC ## POST /websites/vaarhaft/analyze ### Description Analyzes uploaded files to assess suspicion levels and detect AI-generated or tampered content. ### Method POST ### Endpoint /websites/vaarhaft/analyze ### Parameters #### Query Parameters - **files** (file) - Required - The files to be analyzed. ### Request Body (Multipart form data containing files) ### Request Example ``` --boundary Content-Disposition: form-data; name="files"; filename="example.jpg" Content-Type: image/jpeg [Binary file content] --boundary-- ``` ### Response #### Success Response (200) - **suspicion_level** (string) - The overall suspicion level of the request ('Green', 'Yellow', 'Red'). - **Files** (object) - A mapping of filename to file analysis results. - **caseNumber** (string) - The case number assigned to the request. - **sessionId** (string) - A unique identifier generated for the request. - **modelVersions** (object) - Overview of the internal VAARHAFT AI models used for classification. - **generatedModelVersion** (string) - The VAARHAFT AI model used for detection of AI generated images. - **tamperedModelVersion** (string) - The VAARHAFT AI model used for detection of edited images. - **semanticModelVersion** (string) - The VAARHAFT AI model used for semantic analysis of images. - **tokensConsumed** (integer) - The amount of API tokens consumed by this request. #### Response Example ```json { "suspicion_level": "Green", "Files": { "example.jpg": { "suspicion_level": "Green", "error": false, "enabled": true } }, "caseNumber": "Case 123A", "sessionId": "5a8d8fd2-3317-4964-8298-caa96cd5cfa3", "modelVersions": { "generatedModelVersion": "vh-gen-uranus", "tamperedModelVersion": "vh-tp-venus", "semanticModelVersion": "vh-sem-mars" }, "tokensConsumed": 12 } ``` ``` -------------------------------- ### POST /websites/vaarhaft Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= Uploads a file for processing and returns analysis results. Supports various response formats and attachment handling. ```APIDOC ## POST /websites/vaarhaft ### Description Uploads a file for processing and returns analysis results. Supports various response formats and attachment handling. ### Method POST ### Endpoint /websites/vaarhaft ### Parameters #### Path Parameters None #### Query Parameters - **s3_key** (string) - Optional - The S3 key returned by `POST /v2/getUploadUrl`. Use this instead of `file` for ZIPs larger than 10 MB. Either `file` (body) or `s3_key` (query) must be provided — not both, not neither. #### Request Body - **file** (file) - Required - The file to be uploaded. Either `file` (body) or `s3_key` (query) must be provided — not both, not neither. #### Headers - **caseNumber** (string) - Required - A case number to assign to the request. Typically matches the one that you use internally to track the files you're sending us. - **issueDate** (string) - Optional - The issue date of the case, if available. Format: date. - **language** (string) - Optional - The language setting for the request; currently only used for the language of the generated analysis report. Defaults to 'de' (German). Enum: ["de", "en", "pl"] - **Accept** (string) - Optional - Optionally set the desired response media type. Use `application/json` for a JSON response with Base64-encoded attachments grouped by category. If not set, or if `multipart/mixed` or `*/*` is set, the server will respond with JSON plus one or more ZIP attachments in a multipart response. Enum: ["application/json", "multipart/mixed", "*/*"] ### Request Example ```json { "caseNumber": "CASE-12345", "issueDate": "2023-10-27", "language": "en", "Accept": "application/json" } ``` ### Response #### Success Response (200) - **jsonResponse** (object) - Contains the base response details in JSON format. - **attachments** (array) - An array of ZIP files containing attachments generated as part of the analysis process. This may include analysis reports, restored PDF versions, image thumbnails, and heatmap overlays. #### Response Example (application/json) ```json { "jsonResponse": { "message": "Success. The file was successfully uploaded and processed." } } ``` #### Response Example (multipart/mixed) ```json { "jsonResponse": { "message": "Success. The file was successfully uploaded and processed." }, "attachments": [ "base64EncodedZipFile1", "base64EncodedZipFile2" ] } ``` #### Error Responses - **400 Bad Request**: Input validation has failed (e.g. the provided issueDate is not in an allowed format, caseNumber is missing, or an invalid s3_key was provided). - **413 Payload Too Large**: The provided file exceeded the maximum size of 50 MB. - **422 Unprocessable Entity**: The request was not formed correctly. Common causes: neither `file` nor `s3_key` was provided, or both were provided simultaneously. ``` -------------------------------- ### Image Item Analysis Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= Provides details on the structure and analysis results for image items extracted from website files. This includes image quality, metadata, and GPS-related inferences. ```APIDOC ## ImageItem Schema ### Description Represents an image item extracted from the file. ### Properties - **id** (string, UUID) - Unique identifier for the image item. - **item_type** (string, enum: "image", "document") - The type of the item; for image items typically "image". - **position** (string, nullable) - The position of the item within the file (e.g., "Page 1"). May be null if not applicable. - **suspicion_level** (string, enum: "Green", "Yellow", "Red") - An indicator as to how suspicious the contents of the item are. Is calculated from the suspicion levels of the individual analyses. ### Analyses - **imageQuality** (object) - Results of the image quality check. - **result** (boolean) - Indicates if the image meets quality requirements. - **error** (boolean) - Indicates if an error occurred during the image quality analysis. - **metadata** (object) - Extracted metadata of the image. - **inferences** (object) - Inferences across items regarding their metadata. Only applicable if multiple items contain relevant metadata, such as GPS-, timestamp- or model-data. - **distance** (object) - Inferences regarding the distances calculated between the places where the items/images were taken, according to their GPS metadata. - **highest_distance_in_km** (number) - The highest distance in kilometers between this and another given item in the request, according to their GPS metadata. High values may hint at inconsistencies and will trigger flagging. - **highest_distance_item_uuid** (string) - The UUID of another item in the request, if any, that has the highest distance to this item. Only applies if this item has GPS metadata and at least one more item in the request does too. - **gps_outlier** (object) - Inferences regarding clustered GPS data of all items that possess the relevant metadata. - **is_geographical_outlier** (boolean) - Whether the item's GPS metadata is an outlier, compared to other items with GPS metadata in the request. - **distance_from_mean_in_km** (number) - The distance in kilometers of this item's GPS coordinates from the mean of all items with GPS metadata in the request. ``` -------------------------------- ### POST /v2/getUploadUrl Source: https://docs.vaarhaft.com/openapi/fraudscanner/analysefile Retrieves a presigned S3 URL and key for uploading large ZIP files. ```APIDOC ## POST /v2/getUploadUrl ### Description Retrieves a presigned S3 URL and key for uploading large ZIP files. This endpoint is part of the presigned S3 upload flow for files larger than 10 MB. ### Method POST ### Endpoint /v2/getUploadUrl ### Parameters #### Header Parameters - **x-api-key** (string) - Required - The API key for authentication. - **caseNumber** (string) - Required - A case number to assign to the request. ### Request Example ```json { "example": "POST /v2/getUploadUrl with required headers" } ``` ### Response #### Success Response (200) - **upload_url** (string) - The presigned S3 URL for uploading the file. - **s3_key** (string) - The S3 key to be used when calling the /v2/fraudscanner endpoint. #### Response Example ```json { "upload_url": "https://your-s3-bucket.s3.amazonaws.com/path/to/your/file.zip?AWSAccessKeyId=...", "s3_key": "path/to/your/file.zip" } ``` ``` -------------------------------- ### POST /v2/fraudscanner Source: https://docs.vaarhaft.com/openapi/fraudscanner/analysefile Analyzes image and document files for fraud indicators. Supports direct ZIP upload for files under 10 MB and a presigned S3 upload flow for larger files. ```APIDOC ## POST /v2/fraudscanner ### Description Analyzes image and document files for fraud indicators. Supports direct ZIP upload for files under 10 MB and a presigned S3 upload flow for larger files. ### Method POST ### Endpoint /v2/fraudscanner ### Parameters #### Header Parameters - **x-api-key** (string) - Required - The API key for authentication. - **caseNumber** (string) - Required - A case number to assign to the request. - **issueDate** (string) - Optional - The issue date of the case. - **language** (string) - Optional - The language setting for the request. Enum: "de", "en", "pl". Defaults to 'de'. - **Accept** (string) - Optional - The desired response media type. Enum: "application/json", "multipart/mixed", "*/*". #### Query Parameters - **s3_key** (string) - Required - The S3 key returned by POST /v2/getUploadUrl. Use this instead of file for ZIPs larger than 10 MB. Either file (body) or s3_key (query) must be provided — not both, not neither. #### Request Body - **file** (string) - Required - The ZIP file to be uploaded for analysis. Required for direct upload (< 10 MB). Omit when using the presigned S3 upload flow. ### Request Example ```json { "example": "POST /v2/fraudscanner with multipart/form-data containing 'file' or query parameter 's3_key'" } ``` ### Response #### Success Response (200) - **analysis_result** (object) - The result of the fraud analysis. - **attachments** (object) - Grouped attachments by category (if Accept: application/json). #### Response Example ```json { "example": "{\"analysis_result\": {\"fraud_score\": 0.85, \"indicators\": [\"suspicious_pattern\", \"unusual_activity\"]}, \"attachments\": {\"pdfs\": [\"base64encodedpdfcontent\"], \"images\": [\"base64encodedimagecontent\"]}}" } ``` ``` -------------------------------- ### Image Analysis Metadata Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= Retrieves detailed analysis metadata for images, including consistency checks, creation date analysis, and GPS information. ```APIDOC ## GET /websites/vaarhaft/images/{imageId}/analysis ### Description Retrieves detailed analysis metadata for a specific image, including consistency checks across various metadata fields, analyzed creation date information, and GPS coordinates if available. ### Method GET ### Endpoint /websites/vaarhaft/images/{imageId}/analysis ### Parameters #### Path Parameters - **imageId** (string) - Required - The unique identifier of the image. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **metadata_consistency** (object) - Inferences about the consistency of metadata fields like EXIF tags, camera model, and time/GPS data. - **distance_from_cluster_mean_km** (number) - The distance in kilometers from the cluster-mean that was calculated from all items' metadata. - **model_consistency** (object) - Inferences regarding the used model of camera, phone, or other device used to take the image. - **is_consistent** (boolean) - Whether or not the model of the used camera/phone/etc. is consistent across items that possess the relevant metadata information. - **time_consistency** (object) - Inferences regarding GPS metadata in combination with timestamp metadata. - **is_possible** (boolean) - Whether or not it is plausible that all images were taken by one individual, taking into account all available timestamps and corresponding GPS data. - **implied_speed_kmh** (number) - The speed, according to GPS and timestamp metadata, that the individual taking the images must have traveled at, at least. - **analyzed** (object) - Contains analyzed metadata. - **creationDate** (object) - Contains creation date information. - **cDate** (string) - The creation date of the image (or "-" if not found). - **cTime** (string) - The creation time of the image (or "-" if not found). - **isSus** (boolean) - Indicates if the creation date is suspicious. - **diffInDays** (integer) - Difference in days between the creation date and a reference date. - **isTodayUsed** (boolean) - Indicates if the current date was used. - **refDate** (string) - The reference date for checking the creation date. - **imgRanking** (string, nullable) - Ranking of the image based on its analysis. May be null. - **fieldsMarkedSus** (object) - Suspicious fields marked in the metadata. - **GPSInfo** (object) - GPS information of the image, if available. - **is_screenshot** (boolean) - Indicates whether the image is likely a screenshot. #### Response Example { "metadata_consistency": { "distance_from_cluster_mean_km": 402.12, "model_consistency": { "is_consistent": true }, "time_consistency": { "is_possible": true, "implied_speed_kmh": 26.4 } }, "analyzed": { "creationDate": { "cDate": "2023-10-27", "cTime": "10:30:00", "isSus": false, "diffInDays": 5, "isTodayUsed": false, "refDate": "2023-11-01" }, "imgRanking": "high", "fieldsMarkedSus": {} }, "GPSInfo": { "latitude": 48.8566, "longitude": 2.3522 }, "is_screenshot": false } ``` -------------------------------- ### File Analysis Endpoint Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= Retrieves detailed analysis results for a specific file, including its type, suspicion level, and any applicable file-level analyses such as PDF structural information. ```APIDOC ## GET /websites/vaarhaft/file/analysis ### Description This endpoint provides comprehensive analysis data for a given file. It includes the file type, a calculated suspicion level, and detailed results from various analyses performed on the file. ### Method GET ### Endpoint /websites/vaarhaft/file/analysis ### Parameters #### Query Parameters - **file_id** (string) - Required - The unique identifier for the file to be analyzed. ### Request Example ```json { "file_id": "unique_file_identifier_123" } ``` ### Response #### Success Response (200) - **file** (object) - Contains detailed information about the analyzed file. - **file_type** (string) - The type of the file (e.g., "PNG (image file)"). - **suspicion_level** (string) - The calculated suspicion level of the file's content (e.g., "Yellow"). Enum: ["Green", "Yellow", "Red"]. - **file_level_analyses** (object | null) - An object containing results of file-level analyses. Null if no analyses are applicable or were performed. - **pdf_analyses** (object | null) - Specific analysis results for PDF files. Null if the file is not a PDF or analysis was not performed. - **versions** (object | null) - Information about previous versions of the PDF. - **found** (integer) - The number of previous versions found. - **extracted** (integer) - The number of previous versions successfully extracted. - **error** (boolean) - True if an error occurred during PDF version analysis, false otherwise. - **structure** (object | null) - Information about the PDF file's structure. - **creation_dates** (array) - An array of strings representing the creation timestamps found in the PDF metadata. - **mod_dates** (array) - An array of strings representing the modification timestamps found in the PDF metadata. - **inconsistent_metadata_dates** (boolean) - True if metadata dates are inconsistent or suspicious, false otherwise. - **editing_tools** (array) - An array of strings listing detected tools used to modify the PDF. - **annotation_layer_found** (boolean) - True if an annotation layer was found, false otherwise. - **error** (boolean) - True if an error occurred during structural PDF analysis, false otherwise. #### Response Example ```json { "file": { "file_type": "PDF", "suspicion_level": "Yellow", "file_level_analyses": { "pdf_analyses": { "versions": { "found": 2, "extracted": 1, "error": false }, "structure": { "creation_dates": ["2025-02-24 19:30:10 +01:00"], "mod_dates": ["2025-02-24 19:39:03 +01:00"], "inconsistent_metadata_dates": false, "editing_tools": ["Adobe Acrobat"], "annotation_layer_found": true, "error": false } } } } } ``` #### Error Response (400) - **error** (string) - Description of the error (e.g., "File not found", "Invalid file ID"). #### Error Response Example ```json { "error": "File not found" } ``` ``` -------------------------------- ### Image Analysis and Detection Source: https://docs.vaarhaft.com/_bundle/openapi.json?download= This endpoint analyzes an image to detect generated content, tampering, duplicates, and phone numbers. It also performs a reverse image search. ```APIDOC ## POST /websites/vaarhaft/analyze ### Description Analyzes an image for various detection metrics including generated content, tampering, duplicates, and phone numbers. It also supports reverse image search. ### Method POST ### Endpoint /websites/vaarhaft/analyze ### Parameters #### Query Parameters - **generatedDetection** (boolean) - Optional - Enable or disable generated content detection. - **tamperedDetection** (boolean) - Optional - Enable or disable tampered detection. - **doubletCheck** (boolean) - Optional - Enable or disable duplicate check. - **reverseSearch** (boolean) - Optional - Enable or disable reverse image search. - **phoneNumber** (boolean) - Optional - Enable or disable phone number detection. #### Request Body - **image** (string) - Required - Base64 encoded image string. ### Request Example ```json { "image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" } ``` ### Response #### Success Response (200) - **generatedDetection** (object) - Results of generated content detection. - **predictedClassName** (string) - Predicted class name ('gen' for generated, 'real' for real). - **confidence** (number) - Confidence level of the prediction. - **error** (boolean) - Indicates if an error occurred during generated detection. - **enabled** (boolean) - Indicates if generated detection was activated. - **tamperedDetection** (object) - Results of tampered detection. - **predictedClassName** (string) - Predicted class name ('tp' for tampered/edited, 'real' for real). - **confidence** (number) - Confidence level of the prediction. - **error** (boolean) - Indicates if an error occurred during tampered detection. - **enabled** (boolean) - Indicates if tampered detection was activated. - **doubletCheck** (object) - Results of the duplicate comparison. - **result** (boolean) - Indicates if the image was already seen. - **caseNumber** (string) - Case number of the identified duplicate. - **internal** (boolean) - Indicates if the duplicate is internal. - **error** (boolean) - Indicates if an error occurred during the duplicate check. - **enabled** (boolean) - Indicates if duplicate check was activated. - **reverseSearch** (object) - Results of the reverse image search. - **matches** (array) - List of matching images, if any were found. - **url** (string) - URL of the found image. - **score** (number) - Matching score (0-100). - **error** (boolean) - Indicates if an error occurred during reverse search. - **enabled** (boolean) - Indicates if reverse search was enabled. - **phoneNumber** (object) - Results for the detection of phone numbers within the image. - **text** (string) - Detected phone number (if any). - **result** (boolean) - Indicates if a phone number was detected. - **error** (boolean) - Indicates if an error occurred during phone number detection. - **enabled** (boolean) - Indicates if phone number detection was activated. #### Response Example ```json { "generatedDetection": { "predictedClassName": "real", "confidence": 0.95, "error": false, "enabled": true }, "tamperedDetection": { "predictedClassName": "real", "confidence": 0.99, "error": false, "enabled": true }, "doubletCheck": { "result": false, "caseNumber": null, "internal": false, "error": false, "enabled": true }, "reverseSearch": { "matches": [ { "url": "https://example.com/image1", "score": 95 } ], "error": false, "enabled": true }, "phoneNumber": { "text": null, "result": false, "error": false, "enabled": true } } ``` ```