Skip to content

ilandn/itunes-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iTunes API

Maven Central badge Javadocs License build status code coverage

iTunes API is a Java client library providing easy programmatic access to four different iTunes APIs.

Usage

Search

Search for 15 podcasts with CBS Radio as author in the Canadian iTunes store:

Response response = new Search("cbs radio")
	.setCountry(Country.CANADA)
	.setAttribute(Attribute.AUTHOR_TERM)
	.setMedia(Media.PODCAST)
	.setLimit(15)
	.execute();

See also Search API page on apple.com

Lookup

Lookup Bruce Springsteen albums by his iTunes artist id, 178834:

Response response = new Lookup()
	.addId("178834")
	.setEntity(Entity.ALBUM)
	.execute();

See also Lookup API page on apple.com

Feed Generator

The purpose of the Feed Generator API is to create custom RSS feeds of specific iTunes Store content, such as charts and new entries.

This library allows creating feed URLs programmatically. It also allows retrieving the feed content directly.

For example, create a feed URL for the top 10 hot albums for Apple Music in France:

String url = new FeedGenerator()
	.setCountry(Country.FRANCE)
	.setMediaType(MediaType.APPLE_MUSIC)
	.setFeedType(FeedType.HOT_ALBUMS)
	.setResultsLimit(10)
	.getUrl();

To retrieve the feed content directly:

Feed feed = new FeedGenerator()
	.setAllowExplicit(true)
	.setCountry(Country.FRANCE)
	.setMediaType(MediaType.APPLE_MUSIC)
	.setFeedType(FeedType.HOT_ALBUMS)
	.setResultsLimit(10)
	.execute();

See also Feed Generator page on apple.com

Genre ID

Get the full genre hierarchy for the iTunes store, along with relevant links for each genre.

GenreIdsResponse response = new GenreIdsAppendix().getGenres();

See also Genre ID page on apple.com

HTTP connection setup

To reduce external dependencies, iTunes API has a default HTTP implementation relying on java.net.URLConnection. However, using your preferred way to make HTTP requests can be done by implementing the be.ceau.itunesapi.http.Connector interface and passing an instance to the relevant API entry point:

  • be.ceau.itunesapi.Search.execute(Connector)
  • be.ceau.itunesapi.Lookup.execute(Connector)
  • be.ceau.itunesapi.FeedGenerator.execute(Connector)
  • be.ceau.itunesapi.GenreIdsAppendix.execute(Connector)

Requirements

This library requires Java 7 or higher.

Maven Central

Include this project directly from Maven Central

<dependency>
	<groupId>be.ceau</groupId>
	<artifactId>itunes-api</artifactId>
	<version>${project.version}</version>
</dependency>

iTunes Search

iTunes API is an evolution of the iTunes Search library. The new name iTunes API reflects the fact multiple APIs are implemented by the library.

GnuPG public key

Verify signature files with my GnuPG public key.

Javadoc

View javadoc for current release at javadoc.io.

License

Licensed under the Apache 2.0 license.

Disclaimer

iTunes is a trademark of Apple Inc., registered in the U.S. and other countries.

This library has not been authorized, sponsored, or otherwise approved by Apple Inc.

About

Java client for iTunes APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%