{
    "openapi": "3.1.0",
    "info": {
        "title": "TechnoRapper Agent API",
        "version": "1.0.0",
        "summary": "Public, read-only API for TechnoRapper articles and discovery.",
        "description": "Use these GET operations to search TechnoRapper technology coverage, list published article summaries, retrieve article details, browse categories, and check status. No authentication is required for low-volume public reads. The API cannot create or modify content. Preserve canonical URLs, source attribution, and AI disclosure. Respect HTTP 429 and Retry-After."
    },
    "servers": [
        {
            "url": "https://technorapper.com/wp-json/tr/v1",
            "description": "TechnoRapper public API"
        }
    ],
    "tags": [
        {
            "name": "Articles",
            "description": "Discover and retrieve published TechnoRapper articles."
        },
        {
            "name": "Discovery",
            "description": "Search stories, browse categories, and check API availability."
        }
    ],
    "paths": {
        "/articles": {
            "get": {
                "tags": [
                    "Articles"
                ],
                "operationId": "listArticles",
                "summary": "List published articles",
                "description": "Returns a bounded collection of published article summaries. Follow pagination.next_url and pagination.prev_url. Optional date filters use YYYY-MM-DD.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "One-based result page.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Results per page. Defaults to 20; maximum is 50.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50,
                            "default": 20
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Category slug.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "description": "Include articles published on or after this date.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "before",
                        "in": "query",
                        "description": "Include articles published on or before this date.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Page of article summaries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ArticleCollection"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid query parameters.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached. Retry after the indicated delay.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/articles/{id}": {
            "get": {
                "tags": [
                    "Articles"
                ],
                "operationId": "getArticle",
                "summary": "Get an article",
                "description": "Returns one published article, including HTML and plain-text content, canonical URL, category, and provenance fields.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "WordPress numeric article ID from an article response.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Article detail.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ArticleResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Article does not exist or is not published.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/search": {
            "get": {
                "tags": [
                    "Discovery"
                ],
                "operationId": "searchArticles",
                "summary": "Search published articles",
                "description": "Searches published article titles and content and returns bounded article summaries.",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Search query; at least two characters.",
                        "schema": {
                            "type": "string",
                            "minLength": 2
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "One-based result page.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Results per page. Defaults to 20; maximum is 50.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50,
                            "default": 20
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Search results.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ArticleCollection"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or invalid search query.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "tags": [
                    "Discovery"
                ],
                "operationId": "listCategories",
                "summary": "List article categories",
                "description": "Returns non-empty categories that can be used to understand and filter article coverage.",
                "responses": {
                    "200": {
                        "description": "Available categories.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CategoryCollection"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/status": {
            "get": {
                "tags": [
                    "Discovery"
                ],
                "operationId": "getApiStatus",
                "summary": "Get API status",
                "description": "Returns the public Agent API name, version, current status, and discovery links.",
                "responses": {
                    "200": {
                        "description": "API status.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StatusResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ArticleSummary": {
                "type": "object",
                "required": [
                    "id",
                    "wordpress_id",
                    "type",
                    "title",
                    "url",
                    "canonical_url",
                    "published_at",
                    "updated_at",
                    "excerpt",
                    "categories",
                    "author",
                    "provenance",
                    "links"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Stable TechnoRapper article ID, formatted tr-<wordpress_id>.",
                        "example": "tr-123"
                    },
                    "wordpress_id": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "type": {
                        "type": "string",
                        "const": "article"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "canonical_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "published_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "excerpt": {
                        "type": "string"
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Category"
                        }
                    },
                    "image": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    },
                    "author": {
                        "$ref": "#/components/schemas/Author"
                    },
                    "provenance": {
                        "$ref": "#/components/schemas/Provenance"
                    },
                    "links": {
                        "$ref": "#/components/schemas/ArticleLinks"
                    }
                }
            },
            "Article": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ArticleSummary"
                    },
                    {
                        "type": "object",
                        "required": [
                            "content_html",
                            "content_text"
                        ],
                        "properties": {
                            "content_html": {
                                "type": "string",
                                "description": "Rendered article body as HTML."
                            },
                            "content_text": {
                                "type": "string",
                                "description": "Plain-text article body."
                            }
                        }
                    }
                ]
            },
            "Category": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "slug",
                    "url"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "description": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer",
                        "minimum": 0
                    }
                }
            },
            "Author": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    }
                }
            },
            "Provenance": {
                "type": "object",
                "properties": {
                    "ai_wire": {
                        "type": "boolean"
                    },
                    "ai_disclosure": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source_url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    }
                }
            },
            "ArticleLinks": {
                "type": "object",
                "properties": {
                    "self": {
                        "type": "string",
                        "format": "uri"
                    },
                    "canonical": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "Pagination": {
                "type": "object",
                "required": [
                    "page",
                    "per_page",
                    "total",
                    "total_pages",
                    "has_next",
                    "next_url",
                    "prev_url"
                ],
                "properties": {
                    "page": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "per_page": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50
                    },
                    "total": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "total_pages": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "has_next": {
                        "type": "boolean"
                    },
                    "next_url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    },
                    "prev_url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    }
                }
            },
            "ApiMeta": {
                "type": "object",
                "properties": {
                    "api_version": {
                        "type": "string"
                    },
                    "read_only": {
                        "type": "boolean"
                    },
                    "generated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "ArticleCollection": {
                "type": "object",
                "required": [
                    "data",
                    "pagination",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ArticleSummary"
                        }
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/Pagination"
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ApiMeta"
                    }
                }
            },
            "ArticleResponse": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Article"
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ApiMeta"
                    }
                }
            },
            "CategoryCollection": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Category"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ApiMeta"
                    }
                }
            },
            "StatusResponse": {
                "type": "object",
                "required": [
                    "name",
                    "version",
                    "status",
                    "read_only",
                    "documentation",
                    "llms_txt",
                    "updated_at"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "example": "TechnoRapper Agent API"
                    },
                    "version": {
                        "type": "string",
                        "example": "1"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "ok"
                        ]
                    },
                    "read_only": {
                        "type": "boolean"
                    },
                    "documentation": {
                        "type": "string",
                        "format": "uri"
                    },
                    "llms_txt": {
                        "type": "string",
                        "format": "uri"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "ErrorResponse": {
                "type": "object",
                "required": [
                    "code",
                    "message",
                    "data"
                ],
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "required": [
                            "status"
                        ],
                        "properties": {
                            "status": {
                                "type": "integer"
                            },
                            "retry_after": {
                                "type": "integer",
                                "minimum": 1
                            },
                            "resolution": {
                                "type": "object",
                                "properties": {
                                    "documentation": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "openapi": {
                                        "type": "string",
                                        "format": "uri"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}