Not what your were hoping for? Check out the film database or browse past featured trailers.
API UPDATED! After plenty of requests asking for TRAILERS ONLY, we've updated the API to allow for this option. It does, however, require added resources, so the option will only be available to those who REQUEST IT. Email us at the address provided on the lower right of all TA pages, and we'll tell you how to do it.
API UPDATE: IMDB ID! Have a system that runs on IMDB ID numbers? Well, you are in luck! We have recently updated our API to impliment the IMDB ID, for easier use. Example can be found (way) below.
API UPDATE: IMDB ID! Have a system that runs on IMDB ID numbers? Well, you are in luck! We have recently updated our API to impliment the IMDB ID, for easier use. Example can be found (way) below.
TRAILER ADDICT API
The TrailerAddict API was created for website publishers looking to easily embed trailers from TrailerAddict with variables under their control.The TrailerAddict API currently allows for easy embedding of trailers with variables such as width, offset, trailer count, trailers by which film and more. Not only does this page provide web publishers with links and variables to use the API, but coding examples as well.
The TrailerAddict API delivers content in XML, so some type of XML parser will be necessary to use the results provided.
At this point in time, the API does NOT require an API_KEY to work. If the API were to receive too much abuse, an API_KEY requirement will be instated.
API SOURCE
http://api.traileraddict.com/API VARIABLES
Width: In pixels. Provide a width and the height will be created dynamically. If no width variable is provided, the player will default to 450px. Example: width=480 Count: Choose between one to eight trailers to list in the XML. The default number of trailers depends on other variables provided. Eight is the max allowed. Example: count=5
Featured: Yes or No. If featured variable does not exist, the API will default to yes. This will list all trailers TrailerAddict deems popular or important. If featured is set to 'no', then the most recent trailer additions will be listed. Example: featured=yes
Film: Want to list trailers by a particular film? Then you need the film keyword. To find this, just go to the film's page on TrailerAddict. Assuming you want all the trailers for Max Payne, you'd go to the film's page and, in the URL, you'll see: traileraddict.com/tags/max-payne. The keyword for Max Payne is max-payne. Example: film=max-payne
Actor: Want to list trailers only by a particular actor? Then you need the actor's keyword. To find this, go to the actor's page on TrailerAddict. Assuming you want all the trailers with Brad Pitt in them, you'd go to his page and, in the URL, you'll see: traileraddict.com/tags/brad-pitt. The keyword for Brad Pitt is brad-pitt.
Please note that while the variables WIDTH and COUNT work with all API requests, FEATURED, ACTOR and FILM are their very own functions and cannot be combined.
EXAMPLES
You want a single featured trailer that rotates on your site dynamically: http://api.traileraddict.com/?featured=yes
You want an XML to list the last 6 featured trailers on TrailerAddict:
http://api.traileraddict.com/?featured=yes&count=6
You want an XML to list the last 4 featured trailers on TrailerAddict, but you want the embed width to be 720px:
http://api.traileraddict.com/?featured=yes&count=4&width=720
You want the last three trailers released for The Curious Case of Benjamin Button.
http://api.traileraddict.com/?film=curious-case-benjamin-button&count=3
You want the most recent trailer featuring Gerard Butler:
http://api.traileraddict.com/?actor=gerard-butler
You want eight of the most recent trailers featuring Kate Beckinsale. But you also want the trailer to be 640px wide:
http://api.traileraddict.com/?actor=kate-beckinsale&count=8&width=640
PARSING THE API (PHP 5)
Once you have decided on which option(s) to choose, you can parse the API easily through PHP*:
<?php
$upcoming = simplexml_load_file("http://api.traileraddict.com/?featured=yes&count=2");
foreach($upcoming->trailer as $x => $updates)
{
echo $updates->title;
echo '<br>';
echo '<span style="font-size:x-small">Source: <a href="'. $updates->link .'">TrailerAddict</a></span>';
echo '<br>';
//now echo the embedded trailer
echo $updates->embed;
echo '<br><br>';
}
?>
*The XML can be parsed with options other than PHP. If you have PHP 4, there is a great parsing function here with instructions.
More examples can be seen below.
LATEST FEATURE TRAILER
If you want to feature the latest featured trailer from TrailerAddict (embed code only), you can do so by using the following code:
<?php
$upcoming = simplexml_load_file("http://api.traileraddict.com/?featured=yes");
foreach($upcoming->trailer as $x => $updates)
{
//embed trailer
echo $updates->embed;
}
?>
LIST 8 LINKS TO TRAILERS FOR THE DARK KNIGHT
If you were looking to create a list of links to trailers for a given film, this would be one way to do it:
<?php
$upcoming = simplexml_load_file("http://api.traileraddict.com/?film=the-dark-knight&count=8");
foreach($upcoming->trailer as $x => $updates)
{
echo '<a href="'. $updates->link .'">'. $updates->title .'</a><br />';
}
?>
LIST 4 OF THE LATEST TRAILERS W/PHILIP SEYMOUR HOFFMAN
Not only do you want the four latest trailers featuring Philip Seymour Hoffman, but your page can handle video widths up to 740px:
<?php
$upcoming = simplexml_load_file("http://api.traileraddict.com/?actor=philip-seymour-hoffman&count=4&width=740");
foreach($upcoming->trailer as $x => $updates)
{
echo $updates->embed;
echo '<br><br>';
}
?>
IMDB ID Lookup
Have a system already in place that uses IMDB IDs for looking up films? TrailerAddict has recently implimented a beta version using IMDB IDs. But be warned, not all films (older especially) have IMDB ID numbers attached to them just yet. For the sample below, we'll use True Grit. If you search IMDB, you will see the ID number tt1403865 in the URL. That is the ID, but we only want the numbers, not the opening "tt". To get True Grit by IMDB IDyou can run the following query:
<?php
$upcoming = simplexml_load_file("http://api.traileraddict.com/?imdb=1403865&count=4&width=680");
foreach($upcoming->trailer as $x => $updates)
{
echo $updates->embed;
echo '<br><br>';
}
?>
SIMPLE API
Looking for an API that's easier to use for particular/single trailers? TrailerAddict recently added SimpleAPI, a function that gives embedding information, video information, and some general film info. The Simple API mimics the links on TrailerAddict, except with a different subdomain.
http://www.traileraddict.com/trailer/greenberg/trailer
(becomes)
http://simpleapi.traileraddict.com/trailer/greenberg/trailer
(becomes)
http://simpleapi.traileraddict.com/trailer/greenberg/trailer
So, whether you have a link for a clip or a trailer, just swap out "www" in the URL and replace it with "simpleapi". If you wanted the film title, the release date of the film, the large embed code, cast and description of a given trailer...
<?php
$upcoming = simplexml_load_file("http://simpleapi.traileraddict.com/trailer/avatar/trailer-b");
foreach($upcoming->trailer as $x => $updates)
{
echo $updates->film;
echo '<br>';
echo $updates->release_date;
echo '<br>';
echo $updates->cast;
echo '<br>';
echo $updates->description;
echo '<br>';
//now echo the embedded trailer (large)
echo $updates->embed_large;
}
?>






