# Karanfil Labs Visual DNA API — Complete Technical Reference (llms-full.txt) Provider: Karanfil Labs Yazılım ve Teknoloji Anonim Şirketi (Ankara, Türkiye) Website & Developer Portal: https://karanfillabs.com API Base URL: https://api.karanfillabs.com Interactive Docs (Swagger): https://api.karanfillabs.com/docs OpenAPI 3.0.3 Spec: https://karanfillabs.com/openapi.json Indexed 768-d Visual Fingerprints: 87,982,182 (88.0M+) Contact: info@karanfillabs.com --- ## 1. Authentication All commercial endpoints require your secret API key passed via the `X-API-Key` HTTP header: - Header Name: `X-API-Key` - Header Value: `kl_live_YOUR_API_KEY` (generated instantly upon free registration at https://karanfillabs.com/#portal with 50 free test credits). --- ## 2. System Status & Live Vector Counter (`GET /health`) No authentication required. Returns engine health and real-time indexed vector count. ```bash curl -s https://api.karanfillabs.com/health ``` Example Response (`200 OK`): ```json { "status": "ok", "provider": "Karanfil Labs Yazılım ve Teknoloji A.Ş.", "engine": "Visual DNA 768-d CLIP", "collection_status": "green", "indexed_vectors": 87982182 } ``` --- ## 3. Endpoint 1: Identify Movie / TV Episode from Image Frame (`POST /v1/identify`) Uploads a video frame or screenshot (`PNG`, `JPG`, `WEBP` up to 10 MB), extracts its 768-dimensional visual fingerprint in volatile RAM, and returns the closest matching movies or TV series episodes with official TMDB metadata. Query Parameters: - `top_k` (integer, optional, default `5`, range `1..10`): Number of unique matches to return. - `min_score` (number, optional, default `0.70`, range `0.0..1.0`): Minimum cosine similarity threshold. ### cURL Example (Single-Line) ```bash curl -X POST "https://api.karanfillabs.com/v1/identify?top_k=5&min_score=0.70" -H "X-API-Key: kl_live_YOUR_API_KEY" -F "file=@scene_frame.jpg" ``` ### Python (`requests`) Example ```python import requests API_KEY = "kl_live_YOUR_API_KEY" with open("scene_frame.jpg", "rb") as img: resp = requests.post( "https://api.karanfillabs.com/v1/identify", params={"top_k": 5, "min_score": 0.70}, headers={"X-API-Key": API_KEY}, files={"file": img}, timeout=15, ) print(resp.json()) ``` ### Node.js (`fetch` + `FormData`) Example ```javascript import fs from "node:fs"; const form = new FormData(); form.append("file", new Blob([fs.readFileSync("scene_frame.jpg")]), "scene_frame.jpg"); const res = await fetch("https://api.karanfillabs.com/v1/identify?top_k=5&min_score=0.70", { method: "POST", headers: { "X-API-Key": "kl_live_YOUR_API_KEY" }, body: form, }); console.log(await res.json()); ``` ### Example JSON Response (`200 OK`) ```json { "ok": true, "latency_ms": 68.4, "matches": [ { "title": "The Office", "year": 2005, "media_type": "tv_episode", "episode": "S06E14", "tmdb_id": 2316, "confidence": 0.9412 } ], "quota": { "plan": "starter", "remaining_quota": 9999 } } ``` --- ## 4. Endpoint 2: Semantic Scene Search by English Text (`POST /v1/search`) Finds matching movie and TV scenes from natural-language English descriptions without uploading an image. ### cURL Example (Single-Line) ```bash curl -X POST "https://api.karanfillabs.com/v1/search" -H "X-API-Key: kl_live_YOUR_API_KEY" -H "Content-Type: application/json" -d '{"query": "spaceship near black hole", "top_k": 5, "min_score": 0.22}' ``` ### Python (`requests`) Example ```python import requests resp = requests.post( "https://api.karanfillabs.com/v1/search", headers={ "X-API-Key": "kl_live_YOUR_API_KEY", "Content-Type": "application/json", }, json={"query": "spaceship near black hole", "top_k": 5, "min_score": 0.22}, timeout=15, ) print(resp.json()) ``` --- ## 5. Plans & Monthly Quotas (Billed via Merchant of Record Paddle.com) - **Free Trial:** $0 — 50 one-time API test credits upon registration at https://karanfillabs.com/#portal - **Starter Plan:** $29.00 USD / month — 10,000 API requests / month - **Growth Plan:** $99.00 USD / month — 100,000 API requests / month (high-concurrency priority routing) - **Enterprise Plan:** $499.00 USD / month — 1,000,000+ API requests / month, custom distributor catalog indexing & SLA