Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The IMDb currently has two public APIs that are, although undocumented, very quick and reliable (used on their own site through AJAX).</p> <ol> <li><p>A statically cached search suggestions API:</p> <ul> <li><a href="http://sg.media-imdb.com/suggests/a/aa.json" rel="noreferrer">http://sg.media-imdb.com/suggests/a/aa.json</a></li> <li><a href="http://sg.media-imdb.com/suggests/h/hello.json" rel="noreferrer">http://sg.media-imdb.com/suggests/h/hello.json</a></li> <li>Format: JSONP</li> <li><p>Downside:</p> <ul> <li><p>It's in JSONP format, however the callback parameter can not be set by passing a callback-query parameter. In order to use it cross-domain you'll have to use the function name they choose (which is in the "imdb${searchphrase}" format, see example below). Or use a local proxy (e.g. a small php file) that downloads (and caches!) it from IMDb and strips the JSON-P callback, or replaces it with a custom callback.</p></li> <li><p>If there are no results, it doesn't gracefully fallback, but displays an XML error instead</p></li> </ul></li> </ul></li> </ol> <pre class="lang-js prettyprint-override"><code>// Basic window.imdb$foo = function (list) { /* ... */ }; jQuery.getScript('http://sg.media-imdb.com/suggests/f/foo.json'); // Using jQuery.ajax (let jQuery handle the callback) jQuery.ajax({ url: 'http://sg.media-imdb.com/suggests/f/foo.json', dataType: 'jsonp', cache: true, jsonp: false, jsonpCallback: 'imdb$foo' }).done(function (result) { /* ... */ }); // With local proxy to a PHP script replacing imdb$foo with a sanitized // version of $_GET['callback'] (https://stackoverflow.com/a/8811412/319266) jQuery.getJSON('./imdb.php?q=foo&amp;callback=?', function (list) { /* ... */ }); </code></pre> <ol start="2"> <li><p>More advanced search</p> <ul> <li>Name search (json): <a href="http://www.imdb.com/xml/find?json=1&amp;nr=1&amp;nm=on&amp;q=jeniffer+garner" rel="noreferrer">http://www.imdb.com/xml/find?json=1&amp;nr=1&amp;nm=on&amp;q=jeniffer+garner</a></li> <li>Title search (xml): <a href="http://www.imdb.com/xml/find?xml=1&amp;nr=1&amp;tt=on&amp;q=lost" rel="noreferrer">http://www.imdb.com/xml/find?xml=1&amp;nr=1&amp;tt=on&amp;q=lost</a></li> <li>Format: JSON, XML and more</li> <li>Downside: <ul> <li>No JSONP. In order to use from JavaScript cross-domain, a local proxy is required.</li> <li>No documentation, more formats may be available</li> </ul></li> <li>Upside <ul> <li>Live search!</li> <li>Name support for actors as well!</li> <li>Proper fallback to empty object </li> </ul></li> </ul></li> </ol> <p>As said, both of these APIs are undocumented. They could change at any time.</p> <p>See also <a href="https://stackoverflow.com/a/8811412/319266">https://stackoverflow.com/a/8811412/319266</a>, for an example of a JSON API in PHP.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload