{"openapi":"3.1.0","info":{"title":"PSI Tools - PageSpeed Insights + Lighthouse CLI API","description":"Mikroserwis do analizy wydajności stron internetowych.\n\n**Dwa backendy:**\n- `/psi` — Google PageSpeed Insights API v5 (remote Lighthouse)\n- `/lighthouse` — lokalny Lighthouse CLI z Chrome headless\n- `/compare` — oba równolegle z porównaniem\n\nLokalny Lighthouse daje dokładniejsze FCP/LCP dla stron na tym samym serwerze (brak latencji cross-Atlantic). Przydatne do iteracyjnej optymalizacji PSI.","version":"2.0.0"},"paths":{"/health":{"get":{"tags":["System"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/psi":{"get":{"tags":["PSI"],"summary":"Analiza PSI (GET)","description":"Szybka analiza URL przez query parameter - wygodne do testów z przeglądarki.","operationId":"psi_get_psi_get","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"URL strony do analizy","title":"Url"},"description":"URL strony do analizy"},{"name":"strategy","in":"query","required":false,"schema":{"type":"string","description":"mobile / desktop / both","default":"both","title":"Strategy"},"description":"mobile / desktop / both"},{"name":"categories","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Kategorie (comma-separated): performance,accessibility,best-practices,seo","title":"Categories"},"description":"Kategorie (comma-separated): performance,accessibility,best-practices,seo"},{"name":"detailed","in":"query","required":false,"schema":{"type":"boolean","description":"Tryb szczegółowy: pełne dane audytów ze szczegółowymi tabelami (jak GUI pagespeed.web.dev)","default":false,"title":"Detailed"},"description":"Tryb szczegółowy: pełne dane audytów ze szczegółowymi tabelami (jak GUI pagespeed.web.dev)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["PSI"],"summary":"Analiza PSI (POST)","description":"Pełna analiza PageSpeed Insights. Akceptuje pojedynczy URL lub listę URL-i (batch). Zwraca wyniki Lighthouse, metryki, Core Web Vitals i listę nieudanych audytów.","operationId":"psi_post_psi_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PSIRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cache/clear":{"post":{"tags":["System"],"summary":"Wyczyść cache","description":"Czyści cache wyników PSI.","operationId":"clear_cache_cache_clear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/lighthouse":{"get":{"tags":["Lighthouse"],"summary":"Analiza Lighthouse CLI (GET)","description":"Uruchamia lokalny Lighthouse CLI z Chrome headless na tym serwerze. Daje dokładniejsze wyniki FCP/LCP dla stron hostowanych na tym samym serwerze (brak cross-Atlantic latency). Zawsze zwraca pełne dane audytów (detailed=true). Max 2 równoległe analizy.","operationId":"lighthouse_get_lighthouse_get","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"URL strony do analizy","title":"Url"},"description":"URL strony do analizy"},{"name":"strategy","in":"query","required":false,"schema":{"type":"string","description":"mobile / desktop","default":"mobile","title":"Strategy"},"description":"mobile / desktop"},{"name":"categories","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Kategorie (comma-separated): performance,accessibility,best-practices,seo","title":"Categories"},"description":"Kategorie (comma-separated): performance,accessibility,best-practices,seo"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/compare":{"get":{"tags":["Compare"],"summary":"Porównanie Google PSI vs Local Lighthouse","description":"Uruchamia równolegle Google PSI API i lokalny Lighthouse CLI, zwraca oba wyniki do porównania. Przydatne do zrozumienia wpływu latencji sieciowej na wyniki PSI.","operationId":"compare_get_compare_get","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"URL strony do analizy","title":"Url"},"description":"URL strony do analizy"},{"name":"strategy","in":"query","required":false,"schema":{"type":"string","description":"mobile / desktop","default":"mobile","title":"Strategy"},"description":"mobile / desktop"},{"name":"categories","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Kategorie (comma-separated): performance,accessibility,best-practices,seo","title":"Categories"},"description":"Kategorie (comma-separated): performance,accessibility,best-practices,seo"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PSIRequest":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"URL strony do analizy"},"urls":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Urls","description":"Lista URL-i (batch)"},"strategy":{"type":"string","title":"Strategy","description":"Strategia: 'mobile', 'desktop' lub 'both' (domyślnie 'both')","default":"both"},"categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Categories","description":"Kategorie do analizy: performance, accessibility, best-practices, seo (domyślnie wszystkie)"},"detailed":{"type":"boolean","title":"Detailed","description":"Tryb szczegółowy: zwraca pełne dane audytów ze szczegółowymi tabelami (jak GUI pagespeed.web.dev)","default":false}},"type":"object","title":"PSIRequest","examples":[{"categories":["performance","seo"],"strategy":"both","url":"https://example.com"},{"strategy":"mobile","urls":["https://example.com","https://google.com"]}]},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}