Documentation
Data Export API Reference
Browse processing history and export results to CSV/JSON/JSONL
Data API Overview
The Data API provides access to your processing history (descriptions) and bulk export capabilities. All endpoints are prefixed with/api/v2/data and require authentication.
Processing History
GET
/api/v2/data/descriptionsGet paginated history of image descriptions with filtering and search
Request
json
// Query parameters:?start_date=2025-01-01T00:00:00Z // Filter by start date (ISO format)&end_date=2025-01-31T23:59:59Z // Filter by end date (ISO format)&min_confidence=0.8 // Minimum confidence score (0-1) — useful for extraction/rule results&max_confidence=1.0 // Maximum confidence score (0-1) — descriptions return null&search=landscape,mountain // Search terms (comma-separated)&source_types=single,batch // Source types (comma-separated)&offset=0 // Results to skip (default: 0)&limit=100 // Max results to return (1-1000, default: 100)Response
json
{ "items": [ { "id": "desc_001", "type": "description", "source_type": "single", "source_id": "op_abc123", "created_at": "2025-01-15T10:30:00Z", "image_url": "https://example.com/image.jpg", "description": "A mountain landscape with snow-capped peaks...", "confidence_score": null, "verification": null, "image_id": "img_xyz789", "metadata": {} } ], "total_count": 1250, "limit": 100, "offset": 0, "has_more": true, "statistics": { "total_count": 1250, "average_confidence": 0.89, "confidence_distribution": { "0.8-0.9": 450, "0.9-1.0": 800 }, "daily_counts": [{ "date": "2025-01-15", "count": 42 }], "source_distribution": { "single": 500, "batch": 750 } }, "filters_applied": { "date_range_applied": true, "confidence_range_applied": true, "search_applied": true, "source_types_filtered": false, "filter_summary": "Date: 2025-01-01 to 2025-01-31, Min confidence: 0.8" }}Data Export
POST
/api/v2/data/exportExport processing results (descriptions) in CSV, JSON, or JSONL format. The operation is asynchronous -- returns immediately with an export ID.
Request
json
{ "data_type": "descriptions", // "descriptions" "format": "csv", // "csv" | "json" | "jsonl" "start_date": "2025-01-01T00:00:00Z", // Optional: filter by start date "end_date": "2025-01-31T23:59:59Z", // Optional: filter by end date "min_confidence": 0.8, // Optional: minimum confidence (0-1) — filters on extraction/rule results "max_confidence": 1.0, // Optional: maximum confidence (0-1) — descriptions have null confidence "search_terms": ["safety", "equipment"], // Optional: search terms array "source_types": ["single", "batch"], // Optional: source type filter "include_metadata": true, // Include metadata in export (default: true) "include_failed": false, // Include failed results (default: false) "fields": ["id", "description", "confidence_score"], // Optional: specific fields "limit": 10000 // Optional: max records (up to 100000)}Response
json
// 202 Accepted{ "export_id": "550e8400-e29b-41d4-a716-446655440000", "status": "processing", "download_url": null, "record_count": null, "format": "csv", "created_at": "2025-01-15T10:30:00Z", "estimated_completion_time": "2025-01-15T10:31:00Z", "error_message": null}GET
/api/v2/data/export/{export_id}Check the status of an export operation. Returns download URL when completed. Download URLs expire after 1 hour.
Response
json
{ "export_id": "550e8400-e29b-41d4-a716-446655440000", "status": "completed", "download_url": "https://storage.scopix.ai/exports/...", "record_count": 1250, "format": "csv", "created_at": "2025-01-15T10:30:00Z", "estimated_completion_time": null, "error_message": null}
// Possible status values: "pending", "processing", "completed", "failed"
// When failed:{ "export_id": "550e8400-e29b-41d4-a716-446655440000", "status": "failed", "download_url": null, "record_count": null, "format": "csv", "created_at": "2025-01-15T10:30:00Z", "estimated_completion_time": null, "error_message": "Export exceeded maximum record limit"}
