## FACR API – přehled Základní prefixy (podle backendu): - Veřejné proxy a cache: `/api/facr/*` (případně `/api/v1/facr/*` dle konfigurace route) - V příkladech níže předpokládáme kořen `http://localhost:8080/api/facr`. --- ### Hledání klubů GET `/club/search?q=DOTAZ` Vyhledá kluby na fotbal.cz. Podporuje fotbalové (football) kluby. Příklad: ``` GET http://localhost:8080/api/facr/club/search?q=Sparta ``` Tvar odpovědi (zkráceně): ```json { "query": "Sparta", "count": 2, "results": [ { "name": "AC Sparta Praha", "club_id": "00000000-0000-0000-0000-000000000000", "club_type": "football", "url": "https://www.fotbal.cz/...", "logo_url": "https://.../logo.png", "category": "Muži", "address": "..." } ] } ``` --- ### Informace o klubu + Zápasy GET `/club/{type}/{id}` - `{type}`: `football` - `{id}`: UUID klubu z fotbal.cz (zadává se v prvotním nastavení aplikace) Příklad: ``` GET http://localhost:8080/api/facr/club/football/00000000-0000-0000-0000-000000000000 ``` Tvar odpovědi (zkráceně): ```json { "name": "AC Sparta Praha", "club_id": "00000000-0000-0000-0000-000000000000", "club_type": "football", "club_internal_id": "123456", "url": "https://www.fotbal.cz/...", "logo_url": "https://is1.fotbal.cz/media/kluby/.../logo.jpg", "address": "Milady Horákové 98, 160 00 Praha 6", "category": "Muži A", "competitions": [ { "id": "12345", "code": "1. LIGA", "name": "Fortuna Liga", "team_count": "16", "matches_link": "https://www.fotbal.cz/...", "matches": [ { "date_time": "2023-08-12T18:00:00Z", "home": "AC Sparta Praha", "home_id": "00000000-0000-0000-0000-000000000000", "home_logo_url": "https://.../sparta.png", "away": "SK Slavia Praha", "away_id": "11111111-1111-1111-1111-111111111111", "away_logo_url": "https://.../slavia.png", "score": "2:1", "venue": "Stadion Letná", "match_id": "match12345", "report_url": "https://www.fotbal.cz/..." } ] } ] } ``` --- ### Tabulky (Standings) GET `/club/{type}/{id}/table` Vrací tabulky (overall) pro každou soutěž daného klubu. Příklad: ``` GET http://localhost:8080/api/facr/club/football/00000000-0000-0000-0000-000000000000/table ``` Tvar odpovědi (zkráceně): ```json { "name": "AC Sparta Praha", "club_id": "00000000-0000-0000-0000-000000000000", "club_type": "football", "club_internal_id": "123456", "url": "https://www.fotbal.cz/...", "logo_url": "https://is1.fotbal.cz/media/kluby/.../logo.jpg", "competitions": [ { "id": "12345", "code": "1. LIGA", "name": "Fortuna Liga", "team_count": "16", "matches_link": "https://www.fotbal.cz/...", "table": { "overall": [ { "rank": "1", "team": "AC Sparta Praha", "team_id": "00000000-0000-0000-0000-000000000000", "team_logo_url": "https://.../sparta.png", "played": "10", "wins": "8", "draws": "2", "losses": "0", "score": "25:5", "points": "26" } ] } } ] }