{"openapi":"3.1.0","info":{"title":"FakPrays Scraping API","version":"1.0.0","description":"Provider bağımsız, fallback destekli scraping API."},"servers":[{"url":"https://api.emirhankiziloglu.com"}],"security":[{"apiKey":[]},{"bearerAuth":[]}],"paths":{"/health":{"get":{"security":[],"responses":{"200":{"description":"Servis sağlıklı"},"503":{"description":"Servis hazır değil"}}}},"/v1/providers":{"get":{"summary":"Provider sağlık, kota ve performans durumları","responses":{"200":{"description":"Provider listesi"}}}},"/metrics":{"get":{"summary":"Prometheus provider ve kuyruk metrikleri","responses":{"200":{"description":"Prometheus text formatı"}}}},"/v1/scrape":{"post":{"summary":"Senkron scrape isteği","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeRequest"}}}},"responses":{"200":{"description":"Scrape başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeResponse"}}}},"400":{"description":"Geçersiz istek"},"401":{"description":"Geçersiz API anahtarı"},"429":{"description":"Hız sınırı aşıldı"},"502":{"description":"Tüm uygun provider denemeleri başarısız"}}}},"/v1/jobs":{"post":{"summary":"Asenkron scrape işi oluştur","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeRequest"}}}},"responses":{"202":{"description":"İş kuyruğa alındı"}}}},"/v1/jobs/{jobId}":{"get":{"summary":"Asenkron iş durumunu getir","parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"İş durumu"},"404":{"description":"İş bulunamadı"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"ScrapeRequest":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri"},"mode":{"type":"string","enum":["auto","http","browser"],"default":"auto"},"output":{"type":"array","items":{"type":"string","enum":["html","text"]},"default":["html"]},"profileId":{"type":["string","null"]},"metadata":{"type":"object"},"policy":{"type":"object","properties":{"timeoutMs":{"type":"integer","minimum":2000,"maximum":120000,"default":45000},"maxAttempts":{"type":"integer","minimum":1,"maximum":10,"default":5},"maxCostTier":{"type":"integer","minimum":0,"maximum":3,"default":3},"renderJs":{"oneOf":[{"type":"boolean"},{"const":"auto"}]},"providerAllowlist":{"type":"array","items":{"type":"string"}},"providerDenylist":{"type":"array","items":{"type":"string"}}}}}},"ScrapeResponse":{"type":"object","required":["success","requestId","url","provider","durationMs","content","attempts"],"properties":{"success":{"const":true},"requestId":{"type":"string"},"url":{"type":"string"},"finalUrl":{"type":"string"},"statusCode":{"type":"integer"},"provider":{"type":"string"},"durationMs":{"type":"integer"},"content":{"type":"object","properties":{"html":{"type":["string","null"]},"text":{"type":["string","null"]}}},"metadata":{"type":"object"},"attempts":{"type":"array","items":{"type":"object"}}}}}}}