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 struggling with the implementation.
Current Understanding
I found one working example using the =GET() function for stock data:
=GET("https://financial-data-api.p.rapidapi.com/stocks/{ticker}/details","info.name","API_KEY_PLACEHOLDER","ticker","MSFT")
This example doesn’t work for me, and the IMDB API documentation shows a different structure. I’m confused about the {ticker} placeholder syntax.
The IMDB API sample code looks like this:
const fetch = require("node-fetch");
const settings = {
method: 'GET',
url: 'https://movie-database-imdb.p.rapidapi.com/search/title',
params: {query: 'Inception'},
headers: {
'x-rapidapi-host': 'movie-database-imdb.p.rapidapi.com',
'x-rapidapi-key': 'abc123def456ghi789jkl012mno345pqr678stu901vwx234'
}
};
fetch(settings).then(function (result) {
console.log(result.data);
}).catch(function (err) {
console.error(err);
});
When I search IMDB manually, the URL structure is:
https://www.imdb.com/find?query=inception&ref_=nv_sr_sm
I notice the query parameter which seems relevant.
Main Issues
- How should I structure the =GET() function for IMDB data?
- What do the curly braces mean in the URL?
- Every attempt gives me this error:
Error: Request failed for https://movie-database-imdb.p.rapidapi.com returned code 400. Bad Request (use muteHttpExceptions to see full response)
Looking for Help
Can anyone share a working example or point me to beginner-friendly documentation for this setup?