Skip to content

2.3 Filter movies

Felipe Tovar edited this page Feb 24, 2020 · 1 revision

Filter a movie

You can filter by: tomorrow, next week, next month and custom range.

url HTTP method description status
/api/v1/movies/filter GET filter movies 200

Request Header

key value
X-Api-Key SMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Content-Type application/json

Params

If your param is custom_range you can send an extra param range with the dates you want to filter, more examples below:

key value
time Send tomorrow, next week, next month and custom range
range Range of dates separated by :

Examples

get "/api/v1/movies/filter?time=next-week", headers: { "X-Api-Key": "SMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" }

Response body

{
    "status": "200",
    "message": "Movies found",
    "movies": [
        {
            "id": 12,
            "title": "The Warrant",
            "overview": "After fighting in the Civil War, two Union Army buddies find themselves on opposite sides of the law with the post-war peace at risk.",
            "vote_count": 0,
            "poster_path": "/a7RTqHWAQsVeMr1BkSWzeRTaORE.jpg",
            "release_date": "2020-03-03",
            "tmdb_id": 676156,
            "created_at": "2020-02-24T02:11:51.217Z",
            "updated_at": "2020-02-24T02:11:51.217Z"
        }
    ]
}
get "/api/v1/movies/filter?time=custom-range&range=01-01-1980:15-10-2020", headers: { "X-Api-Key": "SMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" }

Response body

{
    "status": "200",
    "message": "Movies found",
    "movies": [
        {
            "id": 1,
            "title": "Toy Story",
            "overview": "Led by Woody, Andy's toys live happily in his room until Andy's birthday brings Buzz Lightyear onto the scene.",
            "vote_count": 11664,
            "poster_path": "/rhIRbceoE9lR4veEXuwCC2wARtG.jpg",
            "release_date": "1995-10-30",
            "tmdb_id": 862,
            "created_at": "2020-02-23T16:32:44.614Z",
            "updated_at": "2020-02-23T16:32:44.614Z"
        },
        {
            "id": 2,
            "title": "Toy Story 2",
            "overview": "Things shift into high gear when an obsessive toy collector named Al McWhiggen, owner of Al's Toy Barn kidnaps Woody. Andy's toys mount a darin..",
            "vote_count": 8745,
            "poster_path": "/3CmK3XurcLeUyMifCR28ibzupbB.jpg",
            "release_date": "1999-10-30",
            "tmdb_id": 863,
            "created_at": "2020-02-23T16:32:44.632Z",
            "updated_at": "2020-02-23T16:32:44.632Z"
        },
        {
            "id": 3,
            "title": "Frozen II",
            "overview": "Elsa, Anna, Kristoff and Olaf head far into the forest to learn the truth about an ancient mystery of their kingdom.",
            "vote_count": 2414,
            "poster_path": "/pjeMs3yqRmFL3giJy4PMXWZTTPa.jpg",
            "release_date": "2019-11-20",
            "tmdb_id": 330457,
            "created_at": "2020-02-23T16:32:44.635Z",
            "updated_at": "2020-02-23T16:32:44.635Z"
        },
        {
            "id": 4,
            "title": "The Predator",
            "overview": "When a kid accidentally triggers the universe's most lethal hunters' return to Earth, only a ragtag crew of ex-soldiers and a disgruntled female scientist can prevent the end of the human race.",
            "vote_count": 2479,
            "poster_path": "/wMq9kQXTeQCHUZOG4fAe5cAxyUA.jpg",
            "release_date": "2018-09-05",
            "tmdb_id": 346910,
            "created_at": "2020-02-23T18:19:44.786Z",
            "updated_at": "2020-02-23T18:19:44.786Z"
        },
        {
            "id": 12,
            "title": "The Warrant",
            "overview": "After fighting in the Civil War, two Union Army buddies find themselves on opposite sides of the law with the post-war peace at risk.",
            "vote_count": 0,
            "poster_path": "/a7RTqHWAQsVeMr1BkSWzeRTaORE.jpg",
            "release_date": "2020-03-03",
            "tmdb_id": 676156,
            "created_at": "2020-02-24T02:11:51.217Z",
            "updated_at": "2020-02-24T02:11:51.217Z"
        },
        {
            "id": 14,
            "title": "Cars",
            "overview": "Lightning McQueen, a hotshot rookie race car driven to succeed, discovers that life is about the journey, not the finish line, when he finds himself unexpectedly detoured in the sleepy Route 66 town of Radiator Springs. On route across the country to the big Piston Cup Championship in California to compete against two seasoned pros, McQueen gets to know the town's offbeat characters.",
            "vote_count": 8730,
            "poster_path": "/jpfkzbIXgKZqCZAkEkFH2VYF63s.jpg",
            "release_date": "2006-06-08",
            "tmdb_id": 920,
            "created_at": "2020-02-24T17:23:12.178Z",
            "updated_at": "2020-02-24T17:23:12.178Z"
        }
    ]
}
Clone this wiki locally