The Movie Database サポート

Hello, I'm doing a web application inspired by NETFLIX, I would like to have the movies sorted by categories, such as movies, popular horror films, action ...

I know that if I use the query discover with with_genre, it works but I would like to have the movies of each genre, is there a request to have them all at once?

I forgot to specify, I also try the query with several genres like "withgenres =" 12,16,27 ", but many movies have several genres, my list is mixed suddenly ...

9 replies (on page 1 of 1)

Jump to last post

I know that if I use the query discover with with_genre, it works but I would like to have the movies of each genre, is there a request to have them all at once?

What exactly do you mean by all at once? More than 20 items per page? If so, no, you'll just have to iterate over all of the pages.

I forgot to specify, I also try the query with several genres like "with_genres ="12,16,27", but many movies have several genres, my list is mixed suddenly ...

Depending what you're looking for, a comma separated values act as an AND query. You'll want to use pipe separated values, this way it's an OR query. Example: with_genres=12|16|27.

Sorting is done by popularity by default, if you want to sort them by another field, check out all of the available sort options from the docs.

Hello, thank you for your reply, I was able to solve my problem sorting by genre, but I just encountered a new problem that concerned the API more. Queries by genre no longer works, I get an error message for some genres in my console google chrome => net :: ERR_CONTENT_DECODING_FAILED 200 (OK)

and Uncaught (Promised) Error: Network Error

Is there a problem with the API? it has appeared for a few hours only.

No, there is no known issue with the API.

Inspect the response and let me know what is being returned. It looks like you're getting a 200 back but getting some data that you're not expecting.

Ok, I think I found the problem, I removed the parameter "region = FR" from my request, I do not understand why suddenly network errors appeared

I want to create filter by using Genres i.e genre_ids. Could any one help me how to write query for that.

Hi @prashanthyandala29,

A simple discover query to look up action movies looks like this:

https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28

If you wanted to look for action and drama, you could use this:

https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28,18

This just scratches the surface of what you can do with discover, make sure to read the docs. There's also a page here, outlining some example discover queries.

Thank you so much for the quick response. Actually I want a single query to both search and for filter(Genres).

The below one is for filter:

const urlString= "https://api.themoviedb.org/3/discover/movie?api_key=***&language=en-US&sort_by=original_title.asc&page=1&with_genres=" + 12

This is for Search

const urlString= "https://api.themoviedb.org/3/search/movie?api_key=***&query=" + avenger

The below one is for both.. but its not working Here Word= search or discover,

searchTerm= avenger or 18
const urlString= "https://api.themoviedb.org/3/" + Word +   "/movie?api_key=***&query=" + searchTerm + "&language=en-US&sort_by=original_title.asc&page=1&with_genres=" + searchTerm

I have just combined both the query's. But it is not working. Could you please do the needful.

It looks like you're assuming they can be requested with the same filters and queries. Search doesn't support discover filters, and discover doesn't support a search query filter, so that won't work.

Please read the documentation:

Hi Travis, please how do I get a response with the movie genre and have the actors, directors, and revenue included

映画やテレビ番組が見つかりませんか?ログインして作成してください。

全般

s 検索バーに移動する
p プロファイルメニューを開く
esc 開いているウィンドウを閉じる
? キーボードショートカットウィンドウを開く

メディアのページ

b 戻る(または該当する場合は親に)
e 編集ページに行く

テレビ番組のシーズンのページ

(右矢印)次のシーズンに行く
(左矢印)前のシーズンに戻る

テレビ番組のエピソードのページ

(右矢印)次のエピソードに進む
(左矢印)前のエピソードに戻る

全ての画像のページ

a 画像追加ウィンドウを開く

全ての編集ページ

t 翻訳選択を開く
ctrl+ s フォームを送信する

ディスカッションのページ

n 新しいディスカッションを作成する
w 監視ステータスを切り替える
p 公開/非公開を切り替える
c 閉じる/開くを切り替える
a アクティビティを開く
r ディスカッションに返信
l 最後の返事に行く
ctrl+ enter メッセージを送信する
(右矢印)次のページ
(左矢印)前のページ

設定

このアイテムを評価したり、リストに追加したりしたいですか?

ログイン

メンバーではありませんか?

登録してコミュニティに参加