I want to get the IMDb links of all films in a category page on Wikipedia, for example: https://en.wikipedia.org/wiki/Category:American_historical_films. I have heard of Wikidata Query Service and PetScan but honestly they are too complicated for me to learn at the moment. Could you please help me how to request the IMDb links using these tools? Thanks in advance.
Asked
Active
Viewed 281 times
0
-
just use a generator via the MWAPI service and attach the IMDB ID then for the collected items, a SPARQL query is sufficient – UninformedUser Jan 12 '22 at 16:09
1 Answers
0
Here is the Wikidata query code
SELECT ?item ?title ?imdb WHERE {
{
SELECT ?item ?title WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "en.wikipedia.org".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle "category:American_historical_films";
mwapi:gcmprop "ids|title";
mwapi:gcmtype "page";
mwapi:gcmlimit "max".
?title wikibase:apiOutput mwapi:title .
?item wikibase:apiOutputItem mwapi:item.
}
}LIMIT 100
}
?item wdt:P345 ?imdb.
} LIMIT 100

arjunaraoc
- 129
- 5