MyMemory: API technical specifications
Quick start with our REST API!
Our REST API has been designed to be as easy as possible to implement and lets you search and contribute to MyMemory archives.
Please, before you start, have a look at the Usage Limits and to the Terms of Service.
Get
Searches MyMemory for matches against a segment.
Call example:
https://api.mymemory.translated.net/get?q=Hello World!&langpair=en|it
Parameter description:
Parameter | Description | Type | Example value |
q | The sentence you want to translate. Use UTF-8. Max 500 bytes |
Mandatory | Hello World! |
langpair | Source and language pair, separated by the | symbol. Use ISO standard names or RFC3066 | Mandatory | en|it |
mt | Enables Machine Translation in results. You can turn it off if you want just human segments |
Optional | 1 (default), 0 |
key | Authenticates the request; matches from your private TM are returned too. Get your key here or use the keygen API |
Optional | |
onlyprivate | If your request is authenticated, returns only matches from your private TM | Optional | 0 (default), 1 |
ip | The IP of the end user generating the request. Recommended for CAT tools and high volume usage Originating IP is always overridden by X-Forwarded-For header, if the latter is set |
Optional | 93.81.217.71 |
de | A valid email where we can reach you in case of troubles. Recommended for CAT tools and high volume usage |
Optional | user@yourdomain.com |
user | Authenticates the request; matches from your private TM are returned too | Optional, but needs the key parameter. Kept for backward compatibility only: now the key parameter alone is sufficient |
Keygen
Generates the key associated with a username.
Call example:
https://api.mymemory.translated.net/keygen?user=username&pass=password
Parameter description:
Parameter | Description | Type | Example value |
user | The username whose key we want to generate | Mandatory | |
pass | The password associated with the username | Mandatory |
Set
Contributes a translation unit (segment and translation) in some language pair to MyMemory.
Without specifying any key parameter, the contribution is available for everybody (Thank you!).
Call example:
https://api.mymemory.translated.net/set?seg=Hello World!&tra=Ciao Mondo!&langpair=en|it
Parameter description:
Parameter | Description | Type | Example value |
seg | The sentence you want to add in source language. Use UTF-8 | Mandatory | Hello World |
tra | The sentence you want to add in target language. Use UTF-8 | Mandatory | Ciao Mondo |
langpair | Source and language pair, separated by the | symbol. Use ISO standard names or RFC3066 | Mandatory | en|it |
key | Authenticates the request; the translation will be submitted into your private TM only. Get your key here or use the keygen API |
Optional | |
de | A valid email where we can reach you in case of troubles. Recommended for CAT tools and high volume usage |
Optional | user@yourdomain.com |
Import
Contributes a whole translation memory (in TMX format) to MyMemory.
It accepts multi-language memories and it autodetects languages from internal meta-information.
Without specifying any key parameter, the contribution is available for everybody (Thank you!).
This method is multipart/form-data only (no GET parameters are allowed).
All fields are type="text" controls, except for tmx which is type="file".
Call example:
https://api.mymemory.translated.net/v2/tmx/import
The API call is non-blocking: it returns as soon as the file upload is finished; the real processing, that will eventually take place depending on system load, can be tracked with status API.
Parameter description:
Form control | Description | Type | Example value |
tmx | The file you want to import. This is the type="file" form control. |
Mandatory | hugefile.tmx |
name | Short import description (file name is autodetected) | Optional | First import |
subj | The subject of the TM you are importing. Use subjects API for a complete list |
Optional | Medical |
private | Whether you want to make it available to other people or just to you | Optional | 0 is public, 1 is private (default) |
key | Authenticates the request. Get your key here or use the keygen API |
Optional | |
surl | Context information for source language, in the form of a URL | Optional | https://www.somesite.com/en/somepage#paragraph |
turl | Context information for target language, in the form of a URL | Optional | https://www.somesite.com/en/somepage#paragraph |
Status
Checks the status of a TM import.
Call example:
https://api.mymemory.translated.net/v2/import/status?uuid=youruuid
Parameter description:
Parameter | Description | Type | Example value |
uuid | Authenticates the request. Insert here the uuid of the import request |
Mandatory |
Subjects
List available subjects in MyMemory for querying and TM importing.
Call example:
https://api.mymemory.translated.net/subjects
Note: We also have an API for on-demand human translation services.