{
    "openapi": "3.1.0",
    "info": {
        "title": "Razem Norge public API",
        "version": "1.0.0",
        "summary": "Read-only JSON access to the articles of Razem Norge, a Polish-language newspaper in Norway.",
        "description": "Razem Norge (https://www.razem.no/) is a Polish-language newspaper for Poles in Norway, published by the association Razem=Sammen. Most articles are in Polish; some are in Norwegian, English and Ukrainian.\n\nThis API is the public, read-only part of the site's WordPress REST API. It needs no key or login. Responses are JSON; lists are paginated with `page` and `per_page` and report the totals in the `X-WP-Total` and `X-WP-TotalPages` headers. Use `_fields` to ask only for the fields you need. Errors are JSON objects with `code`, `message` and `data.status`.\n\nAI agents can also use the MCP server at https://www.razem.no/wp-json/razem-norge/v1/mcp, and any article or section page returns Markdown when requested with `Accept: text/markdown`.\n\nThe articles are copyrighted by their authors and Razem Norge. Quote and link to them with their URL; do not republish them in full.",
        "contact": {
            "name": "Razem Norge",
            "url": "https://www.razem.no/developers/",
            "email": "kontakt@razem.no"
        }
    },
    "externalDocs": {
        "description": "Razem Norge for developers and AI agents",
        "url": "https://www.razem.no/developers/"
    },
    "servers": [
        {
            "url": "https://www.razem.no/wp-json",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "Articles",
            "description": "News articles, guides and opinion pieces."
        },
        {
            "name": "Pages",
            "description": "Static pages such as the about page, contact details and the privacy policy."
        },
        {
            "name": "Sections and topics",
            "description": "Sections (categories) and topics (tags) that articles belong to."
        },
        {
            "name": "Search",
            "description": "Full-text search across articles and pages."
        },
        {
            "name": "MCP",
            "description": "The Model Context Protocol endpoint for AI agents."
        }
    ],
    "paths": {
        "/wp/v2/posts": {
            "get": {
                "operationId": "listArticles",
                "tags": [
                    "Articles"
                ],
                "summary": "List or search articles",
                "description": "Returns published articles, newest first by default. Filter by section or topic ID, by date, or by keywords with `search`.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Keywords to search for in the title and text, e.g. \"NAV zasiłek\". Polish keywords find the most.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "categories",
                        "in": "query",
                        "description": "Only articles in these sections: comma-separated section IDs from /wp/v2/categories.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tags",
                        "in": "query",
                        "description": "Only articles with these topics: comma-separated topic IDs from /wp/v2/tags.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "description": "Only articles published after this date and time (ISO 8601), e.g. 2026-11-01T00:00:00.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "before",
                        "in": "query",
                        "description": "Only articles published before this date and time (ISO 8601).",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "orderby",
                        "in": "query",
                        "description": "Sort order field: publication date (default), relevance (with search), title or last modification.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "date",
                                "relevance",
                                "title",
                                "modified"
                            ],
                            "default": "date"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Sort direction: desc (newest first, the default) or asc.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "desc",
                                "asc"
                            ],
                            "default": "desc"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The items on the requested page.",
                        "headers": {
                            "X-WP-Total": {
                                "$ref": "#/components/headers/X-WP-Total"
                            },
                            "X-WP-TotalPages": {
                                "$ref": "#/components/headers/X-WP-TotalPages"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Article"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/wp/v2/posts/{id}": {
            "get": {
                "operationId": "getArticle",
                "tags": [
                    "Articles"
                ],
                "summary": "Get one article",
                "description": "Returns one published article with its full text as HTML in `content.rendered`.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "The numeric ID.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The item.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Article"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    }
                }
            }
        },
        "/wp/v2/pages": {
            "get": {
                "operationId": "listPages",
                "tags": [
                    "Pages"
                ],
                "summary": "List pages",
                "description": "Returns the published static pages.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Keywords to search for in the title and text.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Only the page with this slug, e.g. \"kontakt\" or \"o-nas\".",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The items on the requested page.",
                        "headers": {
                            "X-WP-Total": {
                                "$ref": "#/components/headers/X-WP-Total"
                            },
                            "X-WP-TotalPages": {
                                "$ref": "#/components/headers/X-WP-TotalPages"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Page"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/wp/v2/pages/{id}": {
            "get": {
                "operationId": "getPage",
                "tags": [
                    "Pages"
                ],
                "summary": "Get one page",
                "description": "Returns one published page with its full text as HTML in `content.rendered`.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "The numeric ID.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The item.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Page"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    }
                }
            }
        },
        "/wp/v2/categories": {
            "get": {
                "operationId": "listSections",
                "tags": [
                    "Sections and topics"
                ],
                "summary": "List sections",
                "description": "Returns the sections (categories) with their IDs, slugs, parent section and number of articles.",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Only the section with this slug, e.g. \"wiadomosci\" or \"zycie-w-norwegii\".",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "parent",
                        "in": "query",
                        "description": "Only the subsections of the section with this ID; 0 for the top-level sections.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "hide_empty",
                        "in": "query",
                        "description": "Leave out sections without articles.",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The items on the requested page.",
                        "headers": {
                            "X-WP-Total": {
                                "$ref": "#/components/headers/X-WP-Total"
                            },
                            "X-WP-TotalPages": {
                                "$ref": "#/components/headers/X-WP-TotalPages"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Term"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/wp/v2/tags": {
            "get": {
                "operationId": "listTopics",
                "tags": [
                    "Sections and topics"
                ],
                "summary": "List topics",
                "description": "Returns the topics (tags) with their IDs, slugs and number of articles.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Only topics whose name contains this text.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Only the topic with this slug.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The items on the requested page.",
                        "headers": {
                            "X-WP-Total": {
                                "$ref": "#/components/headers/X-WP-Total"
                            },
                            "X-WP-TotalPages": {
                                "$ref": "#/components/headers/X-WP-TotalPages"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Term"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/wp/v2/search": {
            "get": {
                "operationId": "search",
                "tags": [
                    "Search"
                ],
                "summary": "Search the site",
                "description": "Searches articles and pages and returns their titles and URLs. Use /wp/v2/posts with `search` to get excerpts and dates as well.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Keywords to search for.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subtype",
                        "in": "query",
                        "description": "Limit the results to articles (post) or pages (page).",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "post",
                                "page",
                                "any"
                            ]
                        }
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The items on the requested page.",
                        "headers": {
                            "X-WP-Total": {
                                "$ref": "#/components/headers/X-WP-Total"
                            },
                            "X-WP-TotalPages": {
                                "$ref": "#/components/headers/X-WP-TotalPages"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/SearchResult"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/razem-norge/v1/mcp": {
            "post": {
                "operationId": "mcp",
                "tags": [
                    "MCP"
                ],
                "summary": "MCP endpoint (Streamable HTTP)",
                "description": "Model Context Protocol endpoint for AI agents. Send one JSON-RPC 2.0 message per request (initialize, tools/list, tools/call); the answer is JSON. Stateless and read-only, with the tools search_articles, list_sections, get_latest_articles and read_page. Server Card: https://www.razem.no/wp-json/razem-norge/v1/mcp/server-card",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/JsonRpcRequest"
                            },
                            "example": {
                                "jsonrpc": "2.0",
                                "id": 1,
                                "method": "tools/call",
                                "params": {
                                    "name": "search_articles",
                                    "arguments": {
                                        "query": "NAV"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A JSON-RPC result or error.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "A notification was received; there is no answer."
                    },
                    "400": {
                        "description": "The body is not one JSON-RPC 2.0 message.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "parameters": {
            "page": {
                "name": "page",
                "in": "query",
                "description": "Page of results, from 1.",
                "required": false,
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                }
            },
            "per_page": {
                "name": "per_page",
                "in": "query",
                "description": "Items per page, at most 100.",
                "required": false,
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 10
                }
            },
            "fields": {
                "name": "_fields",
                "in": "query",
                "description": "Comma-separated fields to return, e.g. \"id,link,title,excerpt,date\". Leaving out `content` makes responses much smaller.",
                "required": false,
                "schema": {
                    "type": "string"
                }
            }
        },
        "headers": {
            "X-WP-Total": {
                "description": "Total number of items.",
                "schema": {
                    "type": "integer"
                }
            },
            "X-WP-TotalPages": {
                "description": "Total number of pages.",
                "schema": {
                    "type": "integer"
                }
            }
        },
        "responses": {
            "BadRequest": {
                "description": "A parameter is invalid.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "No published item with this ID.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "Article": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "date": {
                        "type": "string",
                        "description": "Local time in Norway, ISO 8601 without a time zone."
                    },
                    "date_gmt": {
                        "type": "string",
                        "description": "UTC, ISO 8601 without a time zone."
                    },
                    "modified": {
                        "type": "string",
                        "description": "Local time in Norway, ISO 8601 without a time zone."
                    },
                    "modified_gmt": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL of the page on the site. Cite this URL."
                    },
                    "title": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string"
                            }
                        },
                        "description": "The title, as HTML."
                    },
                    "excerpt": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string"
                            }
                        },
                        "description": "A short summary, as HTML."
                    },
                    "content": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string"
                            }
                        },
                        "description": "The full text, as HTML."
                    },
                    "author": {
                        "type": "integer"
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "IDs of the sections."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "IDs of the topics."
                    },
                    "featured_media": {
                        "type": "integer",
                        "description": "ID of the main image, 0 for none."
                    }
                }
            },
            "Page": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "date": {
                        "type": "string",
                        "description": "Local time in Norway, ISO 8601 without a time zone."
                    },
                    "date_gmt": {
                        "type": "string",
                        "description": "UTC, ISO 8601 without a time zone."
                    },
                    "modified": {
                        "type": "string",
                        "description": "Local time in Norway, ISO 8601 without a time zone."
                    },
                    "modified_gmt": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL of the page on the site. Cite this URL."
                    },
                    "title": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string"
                            }
                        },
                        "description": "The title, as HTML."
                    },
                    "excerpt": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string"
                            }
                        },
                        "description": "A short summary, as HTML."
                    },
                    "content": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string"
                            }
                        },
                        "description": "The full text, as HTML."
                    },
                    "parent": {
                        "type": "integer"
                    }
                }
            },
            "Term": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "parent": {
                        "type": "integer",
                        "description": "ID of the parent section, 0 for none (sections only)."
                    },
                    "count": {
                        "type": "integer",
                        "description": "Number of published articles."
                    },
                    "link": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "SearchResult": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "type": {
                        "type": "string"
                    },
                    "subtype": {
                        "type": "string"
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "code",
                    "message"
                ],
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "Machine-readable error code, e.g. \"rest_post_invalid_id\"."
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable message, in Polish."
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "JsonRpcRequest": {
                "type": "object",
                "required": [
                    "jsonrpc",
                    "method"
                ],
                "properties": {
                    "jsonrpc": {
                        "const": "2.0"
                    },
                    "id": {
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "method": {
                        "type": "string"
                    },
                    "params": {
                        "type": "object"
                    }
                }
            }
        }
    }
}