Setting up IMDB API in Google Sheets
I’m trying to build my first API project and want to pull movie details into a Google Sheet using the movie title as input. I found RapidAPI has a Google Sheets extension but I’m stuck on the implementation.
Current Progress
I found one working example that uses a GET function for stock data:
=GET("https://finance-api.p.rapidapi.com/stock/{ticker}/info","quote.name","API_KEY_HERE","ticker","MSFT")
But when I try to adapt this for IMDB, I get errors. The IMDB API documentation shows this JavaScript example:
var request = require("request").default;
var config = {
method: 'GET',
url: 'https://imdb8.p.rapidapi.com/title/find',
params: {q: 'Inception'},
headers: {
'x-rapidapi-host': 'imdb8.p.rapidapi.com',
'x-rapidapi-key': 'abc123def456ghi789jkl012mno345pqr678stu901vwx234yz567'
}
};
request(config).then(function (result) {
console.log(result.data);
}).catch(function (err) {
console.error(err);
});
Issues I’m Facing
- How do I convert the JavaScript format to Google Sheets GET function?
- What do the curly braces mean in the URL path?
- I keep getting 400 Bad Request errors no matter what I try
- The Google Sheets syntax seems different from the examples
Anyone have experience with this setup or know of better tutorials for beginners?
same issue here! first, check your url encoding - spaces in movie titles need to be properly encoded. also, rapidapi can be picky about the x-rapidapi-host header matching their docs exactly. test with something simple like “jaws” first, then try multi-word titles. that’s how i figured out my 400 errors.
Your problem’s likely with how you’re handling parameters. Google Sheets GET function doesn’t work like JavaScript requests - you can’t just embed parameters in the URL. You need to separate them as individual arguments. The IMDB API wants the search query as parameter ‘q’, so structure it like: =GET("https://imdb8.p.rapidapi.com/title/find", "results[0].id", "YOUR_RAPIDAPI_KEY", "x-rapidapi-host", "imdb8.p.rapidapi.com", "q", "Inception"). I hit similar auth issues with movie APIs last year. Google Sheets handles parameter binding automatically when you split the query parameter from the base URL. Also check that your RapidAPI subscription’s active for the IMDB endpoint - some need paid plans even for testing. Start with a simple movie title search before trying to pull specific fields like ratings or cast info.
Your problem is authentication headers. Google Sheets GET function handles auth differently than JavaScript requests. Those curly braces in URLs are just placeholders - you need real values.
For IMDB API through RapidAPI, try:
=GET("https://imdb8.p.rapidapi.com/title/find?q=Inception", "results[0].title", "YOUR_RAPIDAPI_KEY", "x-rapidapi-host", "imdb8.p.rapidapi.com")
Those 400 errors? Usually means headers aren’t set right. Use your actual RapidAPI key and make sure the host header matches exactly. Also check if your RapidAPI subscription covers the IMDB endpoint you’re hitting.
Tip: Test the API in RapidAPI’s console first to confirm it works before jumping into Google Sheets. Saved me tons of headaches when I dealt with this.