The Movie Database
Author
Arnoud Buzing
Title
The Movie Database
Description
An API binding to the "Movie Database" web api
Category
Other
Keywords
movies, api, television
URL
http://www.notebookarchive.org/2022-02-3r4ox5o/
DOI
https://notebookarchive.org/2022-02-3r4ox5o
Date Added
2022-02-08
Date Last Modified
2022-02-08
File Size
19.85 megabytes
Supplements
Rights
Redistribution rights reserved



The Movie Database
The Movie Database
Arnoud Buzing
Source: https://www.themoviedb.org/
CODE
CODE
TEST
TEST
PLAY
PLAY
Raiders of the Lost Ark
Raiders of the Lost Ark
In[]:=
r=getSearch["movie","raiders of the lost ark"];r["results"]
Out[]=
|
In[]:=
id=r["results",1,"id"]
Out[]=
85
In[]:=
m=getMovie[id]
Out[]=
|
In[]:=
Style[m["overview"],"Text"]
Out[]=
When Dr. Indiana Jones – the tweed-suited professor who just happens to be a celebrated archaeologist – is hired by the government to locate the legendary Ark of the Covenant, he finds himself up against the entire Nazi regime.
In[]:=
config=getConfiguration[]
Out[]=
|
In[]:=
imageBase=config["images","secure_base_url"]
Out[]=
https://image.tmdb.org/t/p/
In[]:=
m["poster_path"]
Out[]=
/ceG9VzoRAVGwivFU403Wc3AHRys.jpg
In[]:=
config["images","poster_sizes",5]
Out[]=
w500
In[]:=
url=URLBuild[{config["images","secure_base_url"],config["images","poster_sizes",2],m["poster_path"]}];poster=Import[url]
Out[]=
In[]:=
url=URLBuild[{config["images","secure_base_url"],config["images","backdrop_sizes",2],m["backdrop_path"]}];backdrop=Import[url]
Out[]=
Popular Movies in 2021
Popular Movies in 2021
◼
discover query syntax: https://developers.themoviedb.org/3/discover/movie-discover
In[]:=
pages=getDiscover["movie",{"primary_release_year""2021","sort_by""popularity.desc"}]["total_pages"]
Out[]=
1362
In[]:=
getDiscover["movie",{"primary_release_year""2021","sort_by""popularity.desc","page"1}]
Out[]=
|
In[]:=
datasets=Table[Pause[.25];getDiscover["movie",{"primary_release_year""2021","sort_by""popularity.desc","page"page}]["results"],{page,5}];
In[]:=
ds=Join@@datasets
Out[]=
|
In[]:=
ids=Normal[ds[All,"id"]]
Out[]=
{634649,524434,568124,425909,438695,811592,512195,624860,460458,860623,580489,644495,566525,739413,763788,843241,585245,589761,829358,516329,460465,459151,811072,787310,826749,438631,550988,754934,617653,370172,522402,756403,744275,508943,728526,436969,385128,877183,633802,482321,675445,523936,774741,592508,497698,763148,476669,685274,656991,451048,609972,337404,763164,772436,791373,818192,831223,770254,399566,823610,885110,672582,588228,581726,893941,762433,597208,876716,379686,568620,637649,646380,775943,525660,895001,639721,839436,887767,726684,423108,859041,623135,610253,820511,618162,527774,896221,632357,670429,768744,573164,754067,785538,630004,793967,796499,831827,614917,922017,895006}
In[]:=
Length[ids]
Out[]=
100
In[]:=
movies=Map[(Pause[.1];getMovie[#])&,ids];
In[]:=
ds2=Dataset[Join[Map[Normal,movies]]]
Out[]=
|
In[]:=
ds2[All,"runtime"]//Normal//Sort//ListPlot
Out[]=


Cite this as: Arnoud Buzing, "The Movie Database" from the Notebook Archive (2022), https://notebookarchive.org/2022-02-3r4ox5o

Download

