Founding churches get 50% off for 12 monthsFounding churches: 50% offApply as a founding churchApply

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#

GET/teachings/{id}/transcriptteachings:read

Choose a format with format: json (the default), vtt or srt. Until the teaching is done the answer is 409 transcript_not_ready.

formatContent-TypeBody
jsonapplication/jsonThe usual envelope with data.origin and data.segments.
vtttext/vtt; charset=utf-8WebVTT, ready to use as a <track> for the HTML video element.
srtapplication/x-subrip; charset=utf-8SubRip, 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.srt

JSON 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#

format=vtt
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=71 on 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_s and end_s into the same transcript.
  • Clips. Cut at start_s and end_s of 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.

Caching

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.

Large transcripts

Send Accept-Encoding: gzip. A transcript of a long message compresses well.

Next steps