-
Notifications
You must be signed in to change notification settings - Fork 107
Home
Hello, this is the main page of the wiki, here you will find some examples about the use of the javascript library.
Before you start you will need a valid api key to interact with the RESTful API of themoviedb.org, please go to their website and ask for one.
Once you have the api key, you can start using the library, below you will find all the available methods including the description and usage example of each of them.
If you find any error with the library or the description please fill a new bug on the issues section.
At the top of the themoviedb.js file you will see something like:
api_key: "",
base_uri: "http://api.themoviedb.org/3/",
images_uri: "http://image.tmdb.org/t/p/",
timeout: 2000,
You will need to update the api_key variable with your api key, you can do this by modifying the file directly or programmatically, for example:
theMovieDb.common.api_key = "apikey";
Currently the RESTful API allow the use of SSL conections, if you like to use that feature you will need to change the base_uri parameter and images_uri, as follow:
theMovieDb.common.base_uri = "https://api.themoviedb.org/3/";
and
theMovieDb.common.images_uri = "https://image.tmdb.org/t/p/";
The last configuration parameter is the timeout, currently it is set to 5000 milliseconds (5 seconds) but you can change it:
theMovieDb.common.timeout = 2000
In this example i'm using two callbacks functions (one for success and one for error responses) that you can define like:
function successCB(data) {
console.log("Success callback: " + data);
};
function errorCB(data) {
console.log("Error callback: " + data);
};
The libray matches one on one with the API described in https://developers.themoviedb.org if you find any error please submit an add bug.
- Configuration
- Account
- Authentication
- Certifications
- Changes
- Collections
- Companies
- Credits
- Discover
- Find
- Genres
- Keywords
- Lists
- Movies
- Networks
- People
- Reviews
- Search
- TV
- TV Seasons
- TV Episodes
Check the possible returned status codes here.
Check the API latest news here.