The Movie Database Support Forum

After having a long read of the API documentation, I can't seem to find anything or something very similar to generate a random movie on each request to the url, ideally I would want each request to the url to return a new movie each time with the following data:

  • Poster image
  • Name of movie
  • Genre
  • Brief description

Please could you let me know if this is possible and point me in the right direction please?

3 Antworten (Seite 1 von 1)

Jump to last post

I actually found a site that is using this sites API but I can't view how they have done it because it is hidden via normal PHP methods: https://www.randomlists.com/random-movies so at least I know its possible now to the name of the movie and the poster image somehow at random? Just if anyone could help me figure out how they done this or the owner of this site is reading this perhaps they can help along with the genre of film and brief description.

Hey @SomeT,

Unfortunately, there is no supported "random item" method on the API. Depending on your requirements, you can use the /movie/latest method to get the latest ID. Our ids are sequential, so randomizing anything from 1..[latest id] would work fine. Just be mindful that many movies have been deleted, so you will no doubt get some ids that doesn't exist.

However, if you are bringing some data in house, you can use our daily ID exports to know what IDs are valid and only randomize them thus saving you a lot of wasted requests hitting a bunch of deleted items.

Once you have the id you want to query, call the get details method which will return all of the data you're looking for.

Ok that all makes sense so far, I am a bit new to using API's so I just have another question, on my API settings page I have API Key (v3 auth) and API Read Access Token (v4 auth) only v3 works in the try it out sections in the documentation therefore my main question is why is this so, what are the differences between the v3 and v4 key?

Es fehlt ein Film oder eine Serie? Logge dich ein zum Ergänzen.

Allgemein

s Fokus auf Suchfeld
p Profil öffnen
esc Fenster schließen
? Tastenkürzel anzeigen

Videos

b Zurück
e Bearbeiten

Staffeln

Nächste Staffel
Vorherige Staffel

Episoden

Nächste Episode
Vorherige Episode

Bilder

a Poster oder Hintergrundbild hinzufügen

Editieren

t Sprachauswahl öffnen
ctrl+ s Speichern

Diskussionen

n Neue Diskussion erstellen
w Beobachten an / aus
p Diskussion öffentlich / privat
c Diskussion öffnen / schließen
a Diskussionsverlauf anzeigen
r Auf Diskussion antworten
l Letzte Antwort anzeigen
ctrl+ enter Senden
Nächste Seite
Vorherige Seite

Einstellungen

Diesen Eintrag bewerten oder zu einer Liste hinzufügen?

Anmelden