{
    "openapi": "3.1.0",
    "info": {
        "title": "andrzejfesnak.pl – API artykułów o finansach osobistych",
        "version": "1.0.0",
        "summary": "Artykuły i odcinki dra Andrzeja Fesnaka (EFC®) o budżecie, kredytach, oszczędzaniu, inwestowaniu, dziecku i podatkach. Publiczne, tylko do odczytu.",
        "description": "Bez rejestracji i kluczy; limit 60 zapytań na minutę z jednego IP. Odpowiedzi zawierają tylko to, co jest na stronie. Linkuj do pola `url`. Serwer MCP z tymi samymi danymi: https://andrzejfesnak.pl/mcp.",
        "contact": {
            "name": "dr Andrzej Fesnak",
            "url": "https://andrzejfesnak.pl/napisz-do-dra-fesnaka/"
        }
    },
    "externalDocs": {
        "description": "Dokumentacja dla agentów (PL/EN)",
        "url": "https://andrzejfesnak.pl/dla-agentow/"
    },
    "servers": [
        {
            "url": "https://andrzejfesnak.pl/wp-json/fesnak/v1"
        }
    ],
    "security": [],
    "paths": {
        "/artykuly": {
            "get": {
                "operationId": "searchArticles",
                "summary": "Artykuły od najnowszych albo trafne do zapytania",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "description": "Zapytanie po polsku, np. \"fundusz awaryjny\", \"nadpłata kredytu\"."
                    },
                    {
                        "name": "dzial",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "budzet",
                                "kredyty",
                                "oszczedzanie",
                                "inwestowanie",
                                "dziecko",
                                "podatki"
                            ]
                        },
                        "description": "Dział (slug z /dzialy)."
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50,
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "liczba": {
                                            "type": "integer"
                                        },
                                        "artykuly": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Artykul"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Za dużo zapytań (60/min na IP). Nagłówek Retry-After.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artykuly/{slug}": {
            "get": {
                "operationId": "getArticle",
                "summary": "Jeden artykuł z pełną treścią w Markdown",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z0-9-]+$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Artykuł",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Artykul"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "tresc_markdown": {
                                                    "type": "string"
                                                },
                                                "cytuj": {
                                                    "type": "string"
                                                },
                                                "zaktualizowano": {
                                                    "type": "string",
                                                    "format": "date"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Brak artykułu",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Za dużo zapytań (60/min na IP). Nagłówek Retry-After.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/dzialy": {
            "get": {
                "operationId": "listSections",
                "summary": "Sześć działów bloga z liczbą artykułów",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Za dużo zapytań (60/min na IP). Nagłówek Retry-After.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/autor": {
            "get": {
                "operationId": "getAuthor",
                "summary": "Autor: kwalifikacje, doświadczenie, kontakt",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Za dużo zapytań (60/min na IP). Nagłówek Retry-After.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/oferta": {
            "get": {
                "operationId": "listOffers",
                "summary": "Konsultacje, kursy i e-booki ze sklepu z cenami",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Za dużo zapytań (60/min na IP). Nagłówek Retry-After.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/status": {
            "get": {
                "operationId": "status",
                "summary": "Stan usługi i świeżość danych",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Za dużo zapytań (60/min na IP). Nagłówek Retry-After.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Blad"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Artykul": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Artykuł na andrzejfesnak.pl – linkuj tutaj."
                    },
                    "tytul": {
                        "type": "string"
                    },
                    "dzial": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "budzet",
                            "kredyty",
                            "oszczedzanie",
                            "inwestowanie",
                            "dziecko",
                            "podatki",
                            null
                        ]
                    },
                    "opublikowano": {
                        "type": "string",
                        "format": "date"
                    },
                    "opis": {
                        "type": "string"
                    },
                    "wideo": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri",
                        "description": "Odcinek na YouTube, jeśli artykuł jest odcinkiem serii."
                    }
                },
                "required": [
                    "slug",
                    "url",
                    "tytul"
                ]
            },
            "Blad": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    }
                }
            }
        }
    }
}