Transcripts
A transcript is the words of a teaching with the time each was spoken. Read it as JSON for your own layout, or as captions for a video player.
Before you start
- A key with
teachings:read. - A teaching whose status is
done.
Read a transcript#
/teachings/{id}/transcriptteachings:readChoose a format with format: json (the default), vtt or srt. Until the teaching is done the answer is 409 transcript_not_ready.
| format | Content-Type | Body |
|---|---|---|
json | application/json | The usual envelope with data.origin and data.segments. |
vtt | text/vtt; charset=utf-8 | WebVTT, ready to use as a <track> for the HTML video element. |
srt | application/x-subrip; charset=utf-8 | SubRip, accepted by most video editors and players. |
curl "$LECTERN_BASE_URL/v1/api/o/$LECTERN_SLUG/teachings/$TEACHING_ID/transcript" \
-H "Authorization: Bearer $LECTERN_API_KEY"
curl "$LECTERN_BASE_URL/v1/api/o/$LECTERN_SLUG/teachings/$TEACHING_ID/transcript?format=vtt" \
-H "Authorization: Bearer $LECTERN_API_KEY" \
-o sermon.vtt
curl "$LECTERN_BASE_URL/v1/api/o/$LECTERN_SLUG/teachings/$TEACHING_ID/transcript?format=srt" \
-H "Authorization: Bearer $LECTERN_API_KEY" \
-o sermon.srtJSON segments#
Each segment has an idx, a start_s and end_s in whole seconds from the start of the recording, and the text. Segments are in order.
{
"origin": "import",
"segments": [
{ "idx": 0, "start_s": 0, "end_s": 20, "text": "Good morning, church. Open your Bibles with me to Matthew chapter eighteen." },
{ "idx": 1, "start_s": 21, "end_s": 44, "text": "Peter comes to Jesus and asks, Lord, how often shall my brother sin against me?" }
]
}origin says where the transcript came from. A transcript you uploaded as a file has import.
WebVTT and SubRip#
WEBVTT
1
00:00:00.000 --> 00:00:20.000
Good morning, church. Open your Bibles with me to Matthew chapter eighteen.
2
00:00:21.000 --> 00:00:44.000
Peter comes to Jesus and asks, Lord, how often shall my brother sin against me?Cue times are whole seconds, written with .000 milliseconds in WebVTT and ,000 in SubRip. Both formats number cues from 1.
Using timestamps#
- Deep links. Add the segment start to a video link, such as
?t=71on YouTube, to jump to the moment. - Scripture moments. Each Scripture citation carries a transcript excerpt around the moment it was spoken. See Notes and Scripture.
- Ask citations. Each cited passage in an answer has
start_sandend_sinto the same transcript. - Clips. Cut at
start_sandend_sof the segments you want. Pad a second or two either side for natural edges.
function timestampLink(videoUrl, startSeconds) {
const url = new URL(videoUrl);
url.searchParams.set("t", String(startSeconds));
return url.toString();
}
const link = timestampLink("https://www.youtube.com/watch?v=jNQXAC9IVRw", 71);
console.log(link);Languages#
The transcript is in the language of the recording, which is reported as language on the teaching (en, for example). When you upload a file, set language if it is not the church’s default.
Cache transcripts on your side instead of fetching one for every page view, and read them again when you have a reason to think the teaching changed.
Send Accept-Encoding: gzip. A transcript of a long message compresses well.