Extension:External Data/Web pages/examples

The following are example uses of the #get_web_data parser function (along with calls to #external_value and #for_external_table to display the information).

You can see these calls in action, with actual results, here.

IMDb
Retrieve data from IMDb, the Internet Movie Database.

Info for ID tt0055630:
 * Name:
 * Year:
 * Director(s):
 * Actors:

You must also obtain an IMDb API key, and add the following to LocalSettings.php:

NCBI taxonomy
Retrieve data from the National Center for Biotechnology Information.

Information for taxon ID 8371:


 * Scientific name:
 * Common name:
 * Division:

PubMed
Retrieve data from PubMed, run by the National Center for Biotechnology Information.

Information for PMID 19782018:
 * Title:
 * Name: ,
 * Journal:
 * Year:
 * Volume:

Scopus
Retrieve data from Elsevier's Scopus database.

Information for 10.1103/PhysRevA.20.1521:
 * Title:
 * Author:
 * "Cited by" count:

You must also obtain an Elsevier API key, and add the following to LocalSettings.php:

Wikidata - individual entry
SPARQL query: SELECT ?item ?itemLabel ?symbol ?atomicNumber ( YEAR( ?discoveryDate ) AS ?discoveryYear ) ?discoverer ?discovererLabel WHERE { VALUES ?item { wd:Q654 }. ?item wdt:P246 ?symbol. ?item wdt:P1086 ?atomicNumber. ?item wdt:P575 ?discoveryDate. ?item wdt:P61 ?discoverer SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

Actual wikitext (which includes this query):

Info for Q654:
 * Name:
 * Symbol:
 * Atomic number:
 * Year discovered:
 * Discoverers: {{#for_external_table:[{{{discovererURL}}} {{{discovererLabel}}}]

Wikidata - full query
All paintings that depict a squirrel.

SPARQL query: SELECT DISTINCT ?painting ?paintingLabel ?creator ?creatorLabel ( YEAR( ?inception ) as ?year ) ?genre ?genreLabel ( SUBSTR( ?str_image, 52 ) AS ?fileName ) WHERE { ?painting wdt:P180 wd:Q9482. ?painting wdt:P170 ?creator. ?painting wdt:P571 ?inception. ?painting wdt:P136 ?genre. ?painting wdt:P18 ?image. BIND (STR(?image) AS ?str_image) SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ORDER BY ?paintingLabel

Actual wikitext (which includes this query):