Docs lokalne API
Minimalna dokumentacja do pracy bez dostępu do kodu źródłowego.
# BAZA URL
https://13-48-149-190.sslip.io
# AUTORYZACJA
GET /api/recipes oraz GET /api/recipes/{id} są publiczne (bez tokenu).
Zapis wymaga tokenu:
- X-API-Key: TWÓJ_TOKEN
albo
- Authorization: Bearer TWÓJ_TOKEN
# ENDPOINTY RECIPE
GET /api/recipes?search=...
GET /api/recipes/{id}
POST /api/recipes
PUT /api/recipes/{id}
DELETE /api/recipes/{id}
Uwaga: POST/PUT/DELETE /api/recipes wymagają też tokenu zapisu:
- X-Recipe-Token: TWÓJ_TOKEN_ZAPISU
(albo ten sam token przez X-API-Key, jeśli serwer tak skonfigurowany)
Payload POST/PUT /api/recipes:
{
"title": "string (1-255)",
"ingredients": "string, min 1 znak",
"instructions": "string, min 1 znak",
"source_url": "string|null, max 2048",
"channel_name": "string|null, max 255",
"tags": "string|null, max 512"
}
Response POST/PUT/GET:
{
"id": 123,
"title": "...",
"ingredients": "...",
"instructions": "...",
"source_url": "...",
"channel_name": "...",
"tags": "..."
}
# ENDPOINT YOUTUBE
POST /api/youtube/transcript
{
"video_id": "fjjp0-YvZKU"
}
Response:
{
"video_id": "fjjp0-YvZKU",
"title": "string",
"channel_name": "string|null",
"transcript": "string"
}
# TYPY BŁĘDÓW
401 /api/*:
- Brak lub zły token przy zapisie (POST/PUT/DELETE) lub przy /api/youtube/transcript
404 /api/youtube/transcript:
- Brak filmu lub brak dostępnej transkrypcji
429 /api/*:
- Przekroczony limit zapytań (Retry-After w nagłówku)
503 /api/youtube/transcript:
- YouTube blokuje bieżące IP
# UŻYCIE ZE SKILLEM
Podstrona /skill zakłada ten przepływ:
1) URL/ID YouTube -> video_id
2) POST /api/youtube/transcript
3) Z transkrypcji budowa krótkiego przepisu
4) POST /api/recipes