Axuda de The Movie Database

Hi! I am working with /person/popular and looking for a way to get that response sorted by most popular, descending/ascending? I don't see any sort query params in the docs. I can get pages, but page items are not sorted by popularity.

https://api.themoviedb.org/3/person/popular?api_key=<>&language=en-US&page=1

Thanks!

4 respostas (na páxina 1 de 1)

Jump to last post

Hi @Torbjor,

The /*/popular methods are indeed sorted by popularity, can you show me what you're seeing when they're not?

2.1.5 :001 > require 'rest_client'
2.1.5 :002 > api_key = "XXX"
2.1.5 :003 > request = RestClient.get 'http://api.themoviedb.org/3/person/popular', { :accept => 'application/json', :params => { :api_key => api_key } }
2.1.5 :004 > parsed_request = JSON.parse(request)
2.1.5 :005 > parsed_request['results'].map { |result| result['popularity'] }
 => [55.193624, 36.873281, 36.340025, 36.016189, 30.976805, 29.763182, 26.366653, 25.500246, 25.305701, 25.089034, 22.588007, 22.029472, 21.889838, 21.838433, 21.055364, 20.255858, 19.558332, 19.48768, 19.225475, 19.2007]

Thanks for the reply! Soon after I sent this I realized I wasn't asking the right question. You are right. What I'd like to ask is, how do you measure popularity? For example, 'Wonder Woman' is in first place today with a popularity score of 106 but 'Beauty and the Beast' is in second place with 65.

Popularity is calculated by a variety of things like page views, the number of ratings and favourites/watchlist additions per day and then release date.

Thanks!

Non podes atopar unha película ou serie? Inicia sesión para creala.

Global

s amosar a barra de procura
p abrir menú do perfil
esc pechar e abrir xanela
? abrir xanela de atallos do teclado

En páxinas de medios

b atrás (ou á principal se aplica)
e ir a editar páxina

En páxinas de tempadas de televisión

(flecha dereita) ir á tempada seguinte
(flecha esquerda) ir á tempada anterior

En páxinas de episodios de televisión

(flecha dereita) ir ao episodio seguinte
(flecha esquerda) ir ao episodio anterior

En todas as páxinas de imaxe

a abrir a xanela de engadir imaxe

En todas as páxinas de edición

t abrir selector de traducións
ctrl+ s enviar formulario

Nas páxinas de debate

n crear un novo debate
w amosar o estado do seguimento
p mudar público/privado
c mudar abrir/pechar
a abrir actividade
r responder no debate
l ir á última resposta
ctrl+ enter eviar a túa mensaxe
(flecha dereita) páxina seguinte
(flecha esquerda) ir á páxina anterior

Configuración

Queres valorar ou engadir o elemento a unha listaxe?

Iniciar sesión