The Movie Database Support

Hello I am trying to use the multi search query. I was trying to follow the example from apiary docs but the example is very unclear. I get a return value saying the pre-requisite ID is invalid, what does that mean? I am trying to search for a an actor/actress and get back all movies and/or TV shows they have been in, is that possible?

2 replies (on page 1 of 1)

Jump to last post

Thank you very much pretty sure this is exactly what I need. One quick thing, I am using Obj-c and I can get the actor brad pitt but trying to get his id has been a little more challenging. This is the JSON object I have of Brad Pitt: { page = 1; results = ( { adult = 0; id = 287; name = "Brad Pitt"; popularity = "7.84036921219752"; "profile_path" = "/kc3M04QQAuZ9woUvH3Ju5T7ZqG5.jpg"; } ); "total_pages" = 1; "total_results" = 1; }

Then I do:

NSDictionary *results = [json objectForKey:@"results"]; //have also tried NSArray and wouldn't it crashed.

This is what it displays:

{ adult = 0; id = 287; name = "Brad Pitt"; popularity = "7.84036921219752"; "profile_path" = "/kc3M04QQAuZ9woUvH3Ju5T7ZqG5.jpg"; }

My question is how do I extract that id number? Thank you again in advance

Simple Sample:

NSString *urlString=[NSString stringWithFormat:@"https://api.themoviedb.org/3/search/person?query=Brad+Pitt&api_key=%@",API_KEY];
NSURL *url = [NSURL URLWithString:urlString];
NSData *data=[NSData dataWithContentsOfURL:url];
NSError *e = nil;

NSDictionary *dic1 = [NSJSONSerialization JSONObjectWithData: data options: NSJSONReadingMutableContainers error: &e];

NSDictionary *dic2=[dic1 objectForKey:@"results"];
for(NSDictionary *itemDic2 in dic2)
{
    NSLog(@"For each row... This row has id=%@",[itemDic2 objectForKey:@"id"]);
}

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login