Full keyword dictionary for one language
const url = 'https://api.legesher.io/v1/languages/example/terms?python_version=3.10';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.legesher.io/v1/languages/example/terms?python_version=3.10'Keywords, builtins, exceptions, and reserved words for a language.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”ISO 639 language code, e.g. ‘es’.
ISO 639 language code, e.g. ‘es’.
Query Parameters
Section titled “ Query Parameters ”Python grammar version used to select the pack.
Python grammar version used to select the pack.
Responses
Section titled “ Responses ”Successful Response
Full term dictionary for one language pack.
object
English builtin → translated builtin.
object
Canonical Python exception name (‘ValueError’) → translated exception type. Keys use Python’s spelling as it appears in code, not the packs’ lowercase storage form.
object
English keyword → translated keyword.
object
Pack version the terms were resolved against.
Python conventions (self/cls) → translated form.
object
Example generated
{ "builtins": { "additionalProperty": "example" }, "exceptions": { "additionalProperty": "example" }, "keywords": { "additionalProperty": "example" }, "language": "example", "python_version": "example", "reserved_words": { "additionalProperty": "example" }}Headers
Section titled “ Headers ”Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.
The language has no pack for the requested Python version.
Envelope for every error response.
object
Machine-readable code + human message for one error.
object
Machine-readable error code, e.g. ‘validation_error’, ‘unsupported_language’, ‘language_pack_not_found’, ‘payload_too_large’, ‘foundation_unavailable’, ‘invalid_source_code’, ‘internal_error’.
Per-field breakdown (validation errors only).
One request-validation problem, stripped of the submitted input.
object
Dotted location of the offending field.
Human-readable description.
Pydantic error type identifier.
Human-readable explanation.
Example generated
{ "error": { "code": "example", "details": [ { "field": "example", "message": "example", "type": "example" } ], "message": "example" }}Headers
Section titled “ Headers ”Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.
A field is missing or malformed, or a language code is not supported.
Envelope for every error response.
object
Machine-readable code + human message for one error.
object
Machine-readable error code, e.g. ‘validation_error’, ‘unsupported_language’, ‘language_pack_not_found’, ‘payload_too_large’, ‘foundation_unavailable’, ‘invalid_source_code’, ‘internal_error’.
Per-field breakdown (validation errors only).
One request-validation problem, stripped of the submitted input.
object
Dotted location of the offending field.
Human-readable description.
Pydantic error type identifier.
Human-readable explanation.
Example generated
{ "error": { "code": "example", "details": [ { "field": "example", "message": "example", "type": "example" } ], "message": "example" }}Headers
Section titled “ Headers ”Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.
The translation engine is unavailable.
Envelope for every error response.
object
Machine-readable code + human message for one error.
object
Machine-readable error code, e.g. ‘validation_error’, ‘unsupported_language’, ‘language_pack_not_found’, ‘payload_too_large’, ‘foundation_unavailable’, ‘invalid_source_code’, ‘internal_error’.
Per-field breakdown (validation errors only).
One request-validation problem, stripped of the submitted input.
object
Dotted location of the offending field.
Human-readable description.
Pydantic error type identifier.
Human-readable explanation.
Example generated
{ "error": { "code": "example", "details": [ { "field": "example", "message": "example", "type": "example" } ], "message": "example" }}Headers
Section titled “ Headers ”Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.