{
  "openapi": "3.1.1",
  "info": {
    "title": "Cartograph Exonyms (what each country is called in 51 languages) API",
    "version": "1.0.0",
    "summary": "See what a country is called in 51 languages, grouped into name families and mapped.",
    "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://cartographexonyms.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "See what a country is called in 51 languages, grouped into name families and mapped.",
        "description": "Shows the name of a country in 51 languages (from Wikidata), writes every name in Latin letters and groups them into spelling families — Deutschland, Duitsland and Tyskland; Allemagne, Alemania and Almanya; Germania and Германия; Niemcy and Německo — and colours a map by the family each country’s main language uses. It is the exonym engine of the Cartograph app.\n\nMethodology:\n- Names: the Wikidata label of the country in each language (CC0), retrieved on 2026-11-14 — usually the short name, sometimes a longer official form.\n- Latin letters: a letter table per script (Cyrillic, Greek, Georgian, Armenian, Hebrew, Arabic and Persian, Devanagari, Japanese kana, Korean Hangul by syllable). Chinese characters are not transliterated and stay ungrouped.\n- Families: the first two consonant sounds after leading articles are removed and similar letters are merged (p/b/f/v/w, t/d/th, k/g/c/q/ch, s/z/sh/ts …). Names with the same key usually share a root, but the key is a spelling heuristic, not an etymology: unrelated names can meet and related ones can split.\n- Map: each country whose main language is one of the 51 is coloured by the family of that language’s name; other countries stay grey. Natural Earth 1:110m outlines, small countries as dots.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "cartograph_exonyms",
        "x-owner-app": "cartograph",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartographExonymsInput"
              },
              "examples": {
                "example1": {
                  "summary": "What Europe calls Germany",
                  "value": {
                    "country": "Germany",
                    "region": "europe"
                  }
                },
                "example2": {
                  "summary": "Names for Greece",
                  "value": {
                    "country": "GR",
                    "region": "europe"
                  }
                },
                "example3": {
                  "summary": "Names for Egypt, mapped across the world",
                  "value": {
                    "country": "Egypt",
                    "region": "world"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartographExonymsResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "CartographExonymsInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "country": {
            "title": "Country (English name or ISO code)",
            "type": "string",
            "maxLength": 60,
            "default": "Germany"
          },
          "region": {
            "title": "Map",
            "type": "string",
            "enum": [
              "world",
              "africa",
              "asia",
              "europe",
              "north-america",
              "south-america",
              "oceania"
            ],
            "default": "europe"
          }
        },
        "required": []
      },
      "CartographExonymsResult": {
        "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": [
              "country",
              "iso2",
              "languages",
              "families",
              "names",
              "ungrouped",
              "mappedCountries",
              "openInApp"
            ],
            "properties": {
              "country": {
                "type": "string"
              },
              "iso2": {
                "type": "string"
              },
              "languages": {
                "type": "integer"
              },
              "families": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "n",
                    "key",
                    "label",
                    "languages",
                    "colour"
                  ],
                  "properties": {
                    "n": {
                      "type": "integer"
                    },
                    "key": {
                      "type": "string",
                      "description": "First two consonant classes."
                    },
                    "label": {
                      "type": "string"
                    },
                    "languages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "colour": {
                      "type": "string"
                    }
                  }
                }
              },
              "names": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "lang",
                    "language",
                    "name",
                    "latin",
                    "family"
                  ],
                  "properties": {
                    "lang": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "latin": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "family": {
                      "type": "integer",
                      "description": "0 = not grouped (Chinese characters)."
                    }
                  }
                }
              },
              "ungrouped": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "mappedCountries": {
                "type": "integer",
                "description": "Countries on the map coloured by the family of their main language."
              },
              "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"
              }
            }
          }
        }
      }
    }
  }
}