- API
- Subtitles
GET
https://send.now/api/file/subtitle?key=1ltghrilhllgrx2b2&file_code=jfru5kl9dhrt
https://send.now/api/file/subtitle?key=1ltghrilhllgrx2b2&file_code=jfru5kl9dhrt&sub_lang=eng&sub_url=https://example.com/holiday.srt
https://send.now/api/file/subtitle?key=1ltghrilhllgrx2b2&file_code=jfru5kl9dhrt&sub_lang=eng&delete=1
| Parameters |
Description |
Example |
Format |
Required |
| key |
API-Key |
1ltghrilhllgrx2b2 |
String |
yes |
| file_code |
File code of one of your videos |
jfru5kl9dhrt |
String |
yes |
| sub_lang |
Language of the subtitles: the three letter code of the site's list (eng, spa, ger, fre ...), the two letter code (en) or the English name. Needed to add or delete |
eng |
String |
no |
| sub_file |
The subtitle file (.srt or .vtt), sent as a multipart form field |
holiday.srt |
File |
no |
| sub_url |
Address of a subtitle file instead of sub_file (.srt or .vtt, http or https) |
https://example.com/holiday.srt |
String |
no |
| delete |
1 = delete the subtitles of sub_lang |
1 |
Number |
no |
cURL example: the subtitles of a video
curl --include \
'https://send.now/api/file/subtitle?key=1ltghrilhllgrx2b2&file_code=jfru5kl9dhrt'
cURL example: add a subtitle file
curl --include \
-F 'file_code=jfru5kl9dhrt' \
-F 'sub_lang=eng' \
-F '[email protected]' \
'https://send.now/api/file/subtitle?key=1ltghrilhllgrx2b2'
Response
{
"msg": "OK",
"result": {
"file_code": "jfru5kl9dhrt",
"subtitles": [
{
"lang": "eng",
"name": "English",
"size": 31554,
"cues": 842,
"src": "UPLOAD",
"url": "https://d134.sendcdn.com/i/00246/q7w9x2k4m6c8_eng_k3j9d8s7a6f5g4h3.vtt?v=1724670000"
},
{
"lang": "ger",
"name": "German",
"size": 33012,
"cues": 840,
"src": "AUTO",
"url": "https://d134.sendcdn.com/i/00246/q7w9x2k4m6c8_ger_p0o9i8u7y6t5r4e3.vtt?v=1724670000"
}
]
},
"status": 200,
"server_time": "2024-08-26 12:19:28"
}
Notice
|
Without sub_lang the call lists the subtitles of the video. With sub_lang and sub_file or sub_url it adds the subtitles of that language, or replaces them, and answers with the list. With delete=1 it deletes the subtitles of that language. The answer is always the list. |
|
/api/upload/sub is the same call under another name (same parameters). |
|
The file is converted to WebVTT and stored on the file server of the video; url is the address of that file (public, but its name cannot be guessed). src says where a track came from: UPLOAD, URL or AUTO (taken out of the video by the site). cues is the number of subtitle lines. |
|
Adding needs the permission of your account to add subtitles and the subtitles feature of the site. Deleting your own subtitles does not need the permission to add them. A copy of somebody else's file (and a file added with Copy) has the subtitles of the original upload, which only its owner can change. A file with a password, a price, Premium only, or end-to-end encryption has no subtitles, because a subtitle file is public to everybody who has its address. The site limits the size of a file, the number of subtitles of a video and the number you can add per hour (429). |
|
Errors: 400 invalid file code, language missing or unknown, no file or address, not an .srt or .vtt file, a file that cannot be read, the file server of the video needs an update; 403 the subtitles feature is off, no permission, a copy or a protected file; 404 no such file; 429 too many subtitles added in the last hour. |
Status code
| 200 |
Everything is OK. Request succeeded |
| 400 |
Bad request (e.g. wrong parameters, a file that is not a subtitle file) |
| 403 |
Permission denied (the feature is off, or not allowed for this file) |
| 404 |
File not found |
| 429 |
Too many subtitles added in the last hour |