I am developing an app that will make a google search from a text input entered by the user.
My question is, do i need to use the google api or is it possible to just make a URL fetch with the user text, like so:
user entered "Skype"
NSURLSessionConfiguration * config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession * session = [NSURLSession sessionWithConfiguration:config];
NSURLRequest * request = [[NSURLRequest alloc]initWithURL:[NSURL URLWithString:@"https://www.google.com/search?q=%@"], userInput];
NSURLSessionDataTask *data = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSDictionary *theDic = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
NSLog(@"%@", theDic);
}];
[data resume];
and in the returned data i will get all the results from the search "Skype". Is it possible?
thanks,