Netflix API Forums

I Need Help!

RSS Feed

Selecting a Random Movie

    • nlnd89
    • Topic created 5 years ago

    I've been looking through the API and I was wondering how to basically select a completely random movie using the API. I've been looking through the documentation and it seems like you can search the catalog for different titles but not necessarily just select a random one. Is there a way to do this?

    Message edited by nlnd89 2 years ago

  1. JR Conlin5 years ago

    Wow, with some of the titles buried deep in our catalog, it's a bit like running barefoot through the dog park, but sure, I'll bite:

    There's no way to "officially" grab a movie title at random, since most folks are actually looking for a specific movie title of interest, That said, there's a number of ways to randomly fetch a movie title of interest using the API.

    One way is to use the search API to return movies matching a given random word or phrase "e.g. 'love', 'banana', 'threat', 'nine'.) having it return max number of results. Then randomly pick one of those returned results. I'd avoid using common stop words like "and", "the", "of", and "or", but most other single words will return something. Our search will try to return any content that comes even close to what your looking for so even words like "xylophone" will return some results, even if they're not specifically related to metallic percussion instruments.

    There are other tricks you could try to pull, but they have a good chance of returning a 404 rather than a title. Just be warned: for every "Citizen Kane", there's a "Mulva: Zombie Ass Kicker"

  2. Hans Granqvist5 years ago

    Alternatively, download the full catalog index and randomly pick one in the set of parsed titles.

[ Page 1 of 1 ]

New posts are not allowed