Skip to content


Repository files navigation

Cari Teks Video API

API service for searching text in YouTube Closed Captions

Cari Teks Video

Table of Contents

🌎 Languages

Read this description in another languages:


Cari Teks Video is Indonesian language of Search Text (in) Video.

This API was intended to be used as an exercise in Vue.js Fundamental webinar. You can watch the playback in YouTube: Vue.js Fundamental. If you curious how this API works under the hood, learn on my blog, Jefrydco: What If We Could Search Any Keyword from Any YouTube Video through Its Closed Captions Text?.

Awesome List

You can take a look on awesome app that make use this API in

API Documentation

Each YouTube URL needs longer time to request at first and cached on next hit.



Method: POST

Query Params:

Parameter Name Data Type Example Value Default Value Required Description
url String - Yes YouTube video URL
q String web - Yes The keyword
page Number 1 1 No Current page number
size Number 10 10 No Number of result returned in one request
marked Boolean (0 or 1) 1 1 No Highlight keyword in search result or not
paginated Boolean (0 or 1) 1 1 No Paginate the result or not


Key Data Type Example Value Description
data Array [{start: 1000, end: 1200, text: "lorem ipsum"}] Search result
meta Record<string, string> {title: "6 Problems with our School System", channelName: "Next School", channelUrl: "", channelLogoUrl: ""} Meta data of the video
first String URL to first page
last String URL to last page
prev String | null URL to prev page. If the value is null, it doesn't have previous page
next String | null URL to next page. If the value is null, it doesn't have next page
total Number 229 Search result total item
page Number 2 Current result page

Each item in data containing:

Key Data Type Example Value Description
start Number 20 In which seconds the keyword is started
end Number 22 In which seconds the keyword is ended
text String "that the current system of <mark class="cvt-highlight">education</mark>" Text contains the keyword


curl -XPOST ''
# Response
  "data": [
      "start": 2,
      "end": 5,
      "text": "that something is wrong with our system of <mark class=\"cvt-highlight\">education</mark>."
      "start": 20,
      "end": 22,
      "text": "that the current system of <mark class=\"cvt-highlight\">education</mark>"
      "start": 222,
      "end": 225,
      "text": "There seems to be no room in the current <mark class=\"cvt-highlight\">education</mark> system"
      "start": 330,
      "end": 332,
      "text": "Our system of <mark class=\"cvt-highlight\">education</mark>,"
      "start": 345,
      "end": 349,
      "text": "fundamentally change our system of <mark class=\"cvt-highlight\">education</mark>."
  "meta": {
    "title": "6 Problems with our School System",
    "channelName": "Next School",
    "channelUrl": "",
    "channelLogoUrl": ""
  "first": "",
  "last": "",
  "prev": null,
  "next": null,
  "total": 5,
  "page": 1


  1. "This method" refers to all steps or explanations I write on this article, Jefrydco: What If We Could Search Any Keyword from Any YouTube Video through Its Closed Captions Text?.
  2. "The API" refers to all the API available in
  3. All of this method is pure entirely for research and experimental purpose.
  4. If YouTube decides to change the behaviour or use some other way, this method probably couldn't work anymore.
  5. Since the API is deployed on free version of Vercel, they do have a restriction for function invocation. If suddenly the API inaccessible, it seems it is already hit the limit.
  6. Because of point number 4 and 5, I can't guarantee that the API will work forever. But I do regularly check whether it's still fine or not.
  7. Please don't use it on production. I won't responsible for any side effect usage of the API on production.
  8. YouTube already have YouTube Data API for Captions to provide the official way of accessing closed captions. Please use that instead of this if you want to use a similar feature on production.
  9. If you found any bug, please submit an issue on the GitHub repository, Cari Teks Video API.


Source code is available under MIT License.