{"openapi":"3.1.0","info":{"title":"Typersguild AI Integration API","description":"Public read-only access to the Typersguild book catalog. No authentication required.","version":"1.0.0"},"servers":[{"url":"https://typersguild.com/api/integrations/ai"}],"paths":{"/search-books":{"get":{"operationId":"searchBooks","summary":"Search the Typersguild book catalog","description":"Search public books by title or author.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1},"description":"Search query (title or author)"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BooksResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/popular-books":{"get":{"operationId":"getPopularBooks","summary":"List popular Typersguild books","description":"Returns popular public books users can practice typing on Typersguild.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Popular books","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BooksResponse"}}}}}}}},"components":{"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["error","code","hint"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code (e.g. missing_query, not_found)"},"hint":{"type":"string","description":"How to resolve the error or which URL to call next"}}},"CatalogBook":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"author":{"type":"string"},"slug":{"type":"string","nullable":true},"isPremium":{"type":"boolean"},"totalPages":{"type":"integer","nullable":true},"coverUrl":{"type":"string","format":"uri","nullable":true,"description":"Sized cover thumbnail URL via /covers/{slug}.jpg?w= (default 120px wide) for markdown images"},"bookUrl":{"type":"string","format":"uri","description":"Canonical book page URL (https://typersguild.com/books/{slug})"}}},"BooksResponse":{"type":"object","properties":{"total":{"type":"integer"},"books":{"type":"array","items":{"$ref":"#/components/schemas/CatalogBook"}}}}}}}