K
Docs
🎬

Find a Movie

info.movieThe AlmanacLook-ups

Finds a film by name and brings back its year, director, main cast, genres, runtime, poster and a short summary, plus links to Wikipedia and IMDb. Add the year when there are remakes: “Dune 2021”.

When to use this
  • →{{movie.length}} reads like 2h 28m; {{movie.runtime}} is the plain number of minutes
  • →Films come from Wikipedia and Wikidata — {{movie.imdb}} links to IMDb when known

On the canvas

This is what Find a Movie looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🎬
Find a Movie
info.movie
Look-ups
queryrequired
e.g. {{input.options.movie}}
asrequired
movie
found
missing
error

Config fields

FieldTypeReqWhat it does
query
e.g. {{input.options.movie}}
textyesWhich movie 🔎
as
movie
textyesSave it as ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{movie.title}}stringThe film's title
{{movie.year}}numberRelease year
{{movie.released}}stringRelease date, like 2010-07-08
{{movie.summary}}stringWhat it's about
{{movie.director}}stringDirector(s)
{{movie.cast}}stringMain cast
{{movie.genres}}stringGenres
{{movie.length}}stringRuntime, like 2h 28m
{{movie.runtime}}numberRuntime in minutes
{{movie.image}}stringLink to the poster
{{movie.url}}stringLink to the Wikipedia article
{{movie.imdb}}stringLink to IMDb (when known)
{{movie.query}}stringWhat was looked up
{{movie.error}}stringWhy it couldn't be looked up

Output ports

foundThe film is in your spark — {{movie.title}} ({{movie.year}})
missingNothing matched — {{…query}} says what they asked for
errorCouldn't ask right now (busy or down) — {{…error}} says why
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
// The film's article (Wikipedia), then its facts (Wikidata)
const search = `${name} hastemplate:"Infobox film"`;
const page = await wikipediaSearch(search); // {{movie.summary}}, {{movie.image}}
const { entities } = await (await fetch(
  `https://www.wikidata.org/w/api.php?action=wbgetentities&ids=${page.wikibase_item}&props=claims&format=json`,
)).json();
const claims = entities[page.wikibase_item].claims;
const year = claims.P577[0].mainsnak.datavalue.value.time.slice(1, 5); // {{movie.year}}
const minutes = Number(claims.P2047[0].mainsnak.datavalue.value.amount); // {{movie.runtime}}