{
  "openapi": "3.1.1",
  "info": {
    "title": "Word Search Maker (Any Language) API",
    "version": "1.0.0",
    "summary": "Printable word searches from your own words, in any language and script.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://printshopwordsearch.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Printable word searches from your own words, in any language and script.",
        "description": "Turn your own word list into a printable word search: grid size automatic or fixed, diagonal and backwards words optional, shared letters allowed or not. Works letter by letter in every script — accents, Cyrillic, Greek, Devanagari, Chinese and right-to-left Arabic — and adds an answer key with every word circled.\n\nMethodology:\n- Words are normalised (Unicode NFC, spaces and punctuation removed, optional capitals with the language’s rules, e.g. Turkish İ) and split into user-perceived characters (Unicode grapheme clusters, UAX #29): one character per cell.\n- Longest words are placed first at random allowed positions (right and down, optionally the two diagonals and all reversed directions); shared letters are preferred when allowed. With automatic size the grid grows from about √(letters × 2) until every word fits.\n- Empty cells get random letters taken from your words, so the filler matches the script. Any word that appears a second time by accident gets its filler letters redrawn, so each word can be found exactly once. Right-to-left word lists are mirrored so “forwards” reads right to left.\n\nChinese, Japanese and Korean grids print only characters in Printshop’s font subsets; missing characters are reported as a warning.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "printshop_word_search",
        "x-owner-app": "printshop",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintshopWordSearchInput"
              },
              "examples": {
                "example1": {
                  "summary": "Space words with diagonals",
                  "value": {
                    "seed": "space-1"
                  }
                },
                "example2": {
                  "summary": "German animals, backwards too",
                  "value": {
                    "words": "Fuchs, Igel, Eichhörnchen, Dachs, Reh, Biber, Hase, Maus, Specht, Eule",
                    "backwards": true,
                    "lang": "de",
                    "seed": "wald"
                  }
                },
                "example3": {
                  "summary": "Arabic words (right to left)",
                  "value": {
                    "words": "شمس\nقمر\nنجمة\nسماء\nبحر\nجبل\nشجرة\nوردة",
                    "lang": "ar",
                    "diagonal": false,
                    "seed": "ar-1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintshopWordSearchResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PrintshopWordSearchInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "words": {
            "title": "Words",
            "description": "One word per line or separated by commas. Spaces and hyphens are dropped in the grid. Up to 60 words.",
            "type": "string",
            "maxLength": 4000,
            "default": "Planet\nComet\nGalaxy\nOrbit\nRocket\nMeteor\nNebula\nGravity\nTelescope\nAstronaut\nSaturn\nEclipse"
          },
          "size": {
            "title": "Grid size (0 = automatic)",
            "type": "integer",
            "minimum": 0,
            "maximum": 30,
            "default": 0
          },
          "diagonal": {
            "title": "Diagonal words",
            "type": "boolean",
            "default": true
          },
          "backwards": {
            "title": "Backwards words",
            "type": "boolean",
            "default": false
          },
          "overlap": {
            "title": "Words may share letters",
            "type": "boolean",
            "default": true
          },
          "uppercase": {
            "title": "Capital letters",
            "type": "boolean",
            "default": true
          },
          "lang": {
            "title": "Language (for capital letters)",
            "type": "string",
            "enum": [
              "en",
              "de",
              "fr",
              "es",
              "it",
              "pt",
              "nl",
              "pl",
              "tr",
              "ru",
              "uk",
              "ar",
              "hi",
              "zh",
              "ja",
              "ko",
              "id"
            ],
            "default": "en"
          },
          "seed": {
            "title": "Seed",
            "description": "The same seed and settings always give the same puzzles. Change it for new ones.",
            "type": "string",
            "maxLength": 80,
            "default": "words-1"
          },
          "title": {
            "title": "Title on the page (optional)",
            "type": "string",
            "maxLength": 120,
            "default": ""
          },
          "answers": {
            "title": "Answer-key pages",
            "type": "boolean",
            "default": true
          },
          "header": {
            "title": "Name and date line",
            "type": "boolean",
            "default": true
          },
          "paper": {
            "title": "Paper size",
            "type": "string",
            "enum": [
              "a3",
              "a4",
              "a5",
              "a6",
              "b5",
              "letter",
              "legal",
              "tabloid",
              "halfletter"
            ],
            "default": "a4"
          },
          "orientation": {
            "title": "Orientation",
            "type": "string",
            "enum": [
              "portrait",
              "landscape"
            ],
            "default": "portrait"
          }
        },
        "required": []
      },
      "PrintshopWordSearchResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "size",
              "rightToLeft",
              "grid",
              "words",
              "missing",
              "seed",
              "pages",
              "puzzlePages",
              "answerPages",
              "pageWidthMm",
              "pageHeightMm",
              "warnings",
              "files",
              "openInApp"
            ],
            "properties": {
              "size": {
                "type": "integer"
              },
              "rightToLeft": {
                "type": "boolean"
              },
              "grid": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "words": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "word",
                    "row",
                    "col",
                    "direction",
                    "length"
                  ],
                  "properties": {
                    "word": {
                      "type": "string"
                    },
                    "row": {
                      "type": "integer"
                    },
                    "col": {
                      "type": "integer"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "length": {
                      "type": "integer"
                    }
                  }
                }
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "seed": {
                "type": "string"
              },
              "pages": {
                "type": "integer"
              },
              "puzzlePages": {
                "type": "integer"
              },
              "answerPages": {
                "type": "integer"
              },
              "pageWidthMm": {
                "type": "number"
              },
              "pageHeightMm": {
                "type": "number"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "files": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "pdf",
                  "svg",
                  "png"
                ],
                "properties": {
                  "pdf": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  },
                  "svg": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  },
                  "png": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  }
                }
              },
              "openInApp": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}