{"record":{"id":"1cb53e290775a4e2","repo":"languagetool-org/languagetool","slug":"missing-arguments-for-languagetool-api-please-see","errorCode":null,"errorMessage":"Missing arguments for LanguageTool API. Please see ","messagePattern":"Missing arguments for LanguageTool API\\. Please see ","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"warning","filePath":"languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java","lineNumber":217,"sourceCode":"        sendError(httpExchange, code, errorMessage);\n        logError(errorMessage, code, parameters, httpExchange);\n        return;\n      }\n      if (workQueueFull(httpExchange, parameters, \"Error: There are currently too many parallel requests. Please try again later.\")) {\n        ServerMetricsCollector.getInstance().logRequestError(ServerMetricsCollector.RequestErrorType.QUEUE_FULL);\n        return;\n      }\n      if (allowedIps == null || allowedIps.contains(origAddress)) {\n        if (path.startsWith(\"/v2/\")) {\n          ApiV2 apiV2 = new ApiV2(textCheckerV2, config.getAllowOriginUrl());\n          String pathWithoutVersion = path.substring(\"/v2/\".length());\n          final Map<String, String> finalParameters = parameters;\n          final String finalRemoteAddress = remoteAddress;\n          TelemetryProvider.INSTANCE.createSpan(\"/v2\", Attributes.empty(), () -> apiV2.handleRequest(pathWithoutVersion, httpExchange, finalParameters, errorRequestLimiter, finalRemoteAddress, config));\n        } else if (path.endsWith(\"/Languages\")) {\n          throw new BadRequestException(\"You're using an old version of our API that's not supported anymore. Please see \" + API_DOC_URL);\n        } else if (path.equals(\"/\")) {\n          throw new BadRequestException(\"Missing arguments for LanguageTool API. Please see \" + API_DOC_URL);\n        } else if (path.contains(\"/v2/\")) {\n          throw new BadRequestException(\"You have '/v2/' in your path, but not at the root. Try an URL like 'http://server/v2/...' \");\n        } else if (path.equals(\"/favicon.ico\")) {\n          sendError(httpExchange, HttpURLConnection.HTTP_NOT_FOUND, \"Not found\");\n        } else {\n          throw new BadRequestException(\"This is the LanguageTool API. You have not specified any parameters. Please see \" + API_DOC_URL);\n        }\n      } else {\n        String errorMessage = \"Error: Access from \" + StringTools.escapeXML(origAddress) + \" denied\";\n        sendError(httpExchange, HttpURLConnection.HTTP_FORBIDDEN, errorMessage);\n        throw new RuntimeException(errorMessage);\n      }\n    } catch (Exception e) {\n      String response;\n      int errorCode;\n      boolean textLoggingAllowed = false;\n      boolean logStacktrace = true;\n      Throwable rootCause = ExceptionUtils.getRootCause(e);","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java#L199-L235","documentation":"Thrown by LanguageTool's embedded HTTP server when a client requests the server root path ('/') without any parameters. The server expects API calls at a versioned path like /v2/check; hitting bare '/' means no API endpoint or arguments were given. The message points to the API documentation URL.","triggerScenarios":"HTTP GET/POST to the server root URL exactly '/' instead of '/v2/check' or another /v2/ endpoint.","commonSituations":"Developers curl the server root to test if it is up, misconfigured reverse proxies strip the /v2/check path, or users paste the base server URL into a browser expecting a UI.","solutions":["Call a real API endpoint such as POST http://server/v2/check with text and language parameters","Check that your client/proxy is not stripping the /v2/check path from the URL","Consult the linked API documentation for the correct endpoint and required parameters"],"exampleFix":"// before\ncurl http://localhost:8081/\n// after\ncurl -X POST http://localhost:8081/v2/check -d 'text=my text&language=en-US'","handlingStrategy":"validation","validationCode":"const url = new URL(serverUrl);\nif (url.pathname === '/' || !url.pathname.startsWith('/v2/')) {\n  throw new Error(`Use /v2/check endpoint, got path '${url.pathname}'`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always target /v2/check with text and language parameters","Use health endpoints or TCP checks instead of GET / for liveness","Verify reverse proxies preserve the full /v2/... path"],"tags":["http","languagetool","wrong-endpoint"],"backgroundTag":"invalid-url","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}