Skip to Content
Kevinbk
  • Articles
  • Shop
  • Courses
  • Forum
  • Roblox
  • 0
  • 0
  • EN FR DE IT KO PT ES
  • Sign in
Kevinbk
  • 0
  • 0
    • Articles
    • Shop
    • Courses
    • Forum
    • Roblox
  • EN FR DE IT KO PT ES
  • Sign in

Obtain TMDB IDs in bulk by name

Descubra métodos eficientes para coletar identificadores de filmes e séries de forma automatizada.
  • All Blogs
  • Knowledge
  • Obtain TMDB IDs in bulk by name
  • October 13, 2025 by
    Obtain TMDB IDs in bulk by name
    Kevinbk
    | No comments yet

    In this article we will teach you how to obtain IDs from TMDB (Themobiedatabase) through the name of the series or film using a script in Google Sheet and a function called “=searchTMDbId”.

    There was a JustWatch Widget that I wanted to put on my website for a long time, I had a database of animes, but I didn't have TMDB IDs for each anime. So I created this script that made the process of obtaining IDs very quick and practical.

    The first thing you should do is add the Apps Script to your form, save and run the script, so you will be able to use the formula without problems in Google Sheet.

    Apps Script for TMDB

    Follow the code below:

    // Função para buscar o ID de uma obra pelo nome usando a API do TMDbfunction searchTMDbId(name) { var apiKey = '80387065ffe0b71fa2f11fecfa92a146'; // Substitua pelo sua chave de API do TMDb var apiUrl = 'https://api.themoviedb.org/3/search/tv'; var query = encodeURIComponent(name); var response = UrlFetchApp.fetch(apiUrl + '?api_key=' + apiKey + '&query=' + query); var data = JSON.parse(response.getContentText()); if (data.results.length > 0) { return data.results[0].id; // Retorna o ID da primeira obra encontrada } else { return 'Obra não encontrada'; }}

    in Knowledge
    Sign in to leave a comment
    Cheaper Deepl Translation API
    Como economizar na tradução automática com a API do Deepl
    © Kevinbk- All Rights Reserved - Terms & Policy