So I am using the movieDB (https://developers.themoviedb.org/3/find/find-by-id) and using it to search for movies in various ways i.e popularity, by name or by ID. I want to now implement a random movie generator onto my site, there is no explicit way to do this on the documentation.
Here is a method I used to search by ID, I have taken the key out, also value in the case below represents the ID of a movie.
private _TheMovieDb: string = 'https://api.themoviedb.org/3/movie/';
getOneMovie(value): Observable<any> {
return this._http.get<any>(this._TheMovieDb + value + '?api_key=MyKey')
.do(data => console.log('All: ' + JSON.stringify(data)))
.catch(this.handleError);
}
My question: I want to search for a random movie ID, how to I randomise the ID and search for it?