Skip to content

davidhlee/AJS-iTunes-API

 
 

Repository files navigation

AJS iTunesAPI

AJSiTunesAPI is a simple, asynchronous Cocoa API controller and object for searching the iTunes Search API on either Mac OSX or iOS projects.

This library is a work-in-progress, but current features should work as expected. Support for iTunes lookups from artist ID is omitted, and planned.

Requirements

AJSITunesAPI 0.2.0 uses the latest version of AFNetworking, and as a result is compatible only with project supporting iOS7, or OSX 10.9 Mavericks.

Documentation

For a rundown of the type of results to expect, source documentation of the API can be found here: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html

Results are parsed to Cocoa objects, with properties for most of the returned data. Check the header files for data types and properties supported.

Installation

Installation is super easy, using Cocoapods. Just add the pod 'AJSITunesAPI', :git => 'https://github.com/andysmart/AJS-iTunes-API' to your Podfile and run pod install.

Usage

AJSITunesAPI is now fully block based, and much simpler as a result. Use one of the two convenience methods on AJSITunesClient, and receive an NSArray of AJSITunesResult objects.

AJSITunesClient *client = [AJSITunesClient sharedClient];
[client searchMedia:@"batman" completion:^(NSArray *results, NSError *error) {
	NSLog(@"Finished with results: %@", results);
}];

Or, if you need a bit more control:

AJSITunesClient *client = [AJSITunesClient sharedClient];
[client searchMediaWithType:AJSITunesMediaTypeMovie
  keywords:@"batman"
   country:@"US"
	 limit:10
completion:(NSArray *results, NSError *error) {
	NSLog(@"Finished with results: %@", results);
}];

License

Standard MIT deal, see LICENSE for details.

About

Cocoa wrapper for the iTunes search API - for iOS and Mac OSX projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 94.4%
  • Ruby 5.6%