# Apple iTunes Media Metadata Fetcher (`brunofin/apple-itunes-media-fetcher`) Actor

Fetch media metadata (music, movies, podcasts, audiobooks, music videos) from the Apple iTunes Search API. No API key required — fully keyless JSON API.

- **URL**: https://apify.com/brunofin/apple-itunes-media-fetcher.md
- **Developed by:** [Bruno Finger](https://apify.com/brunofin) (community)
- **Categories:** For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Apple iTunes Media Metadata Fetcher

Fetches media metadata from the **Apple iTunes Search API** — music tracks, albums, artists, music videos, movies, podcasts, audiobooks, and more. Fully keyless, no API key required.

### Features

- **Search across all Apple media types**: music, movies, podcasts, audiobooks, TV shows, apps, e-books, music videos
- **Rich metadata**: track/album/artist names, pricing, release dates, genres, artwork (30/60/100px), preview URLs, Apple Music links
- **Flexible filtering**: by entity type, search attribute, media type, country store, result limit
- **PAY_PER_EVENT pricing**: charged per media item returned
- **No authentication needed**: uses the public, keyless iTunes Search API

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `term` | string | Yes | — | Search query (artist, song, movie, podcast, etc.) |
| `entity` | enum | No | `musicTrack` | Media entity type: `musicTrack`, `album`, `artist`, `musicVideo`, `movie`, `podcast`, `audiobook`, `shortFilm`, `tvShow`, `software`, `ebook`, `all` |
| `attribute` | enum | No | `all` | Search attribute filter |
| `limit` | integer | No | `50` | Max results (1–200) |
| `country` | string | No | `US` | Two-letter country code (US, GB, DE, JP, etc.) |
| `media` | enum | No | `all` | Media type filter: `music`, `movie`, `podcast`, `audiobook`, `shortFilm`, `tvShow`, `software`, `ebook`, `all` |

### Output Fields

Each dataset record contains:

- **Identity**: `trackId`, `artistId`, `collectionId`, `wrapperType`, `kind`
- **Names**: `trackName`, `artistName`, `collectionName`, `trackCensoredName`, `collectionCensoredName`
- **URLs**: `trackViewUrl`, `collectionViewUrl`, `artistViewUrl`, `previewUrl`
- **Artwork**: `artworkUrl30`, `artworkUrl60`, `artworkUrl100`
- **Pricing**: `trackPrice`, `collectionPrice`, `currency`, `country`
- **Metadata**: `releaseDate`, `primaryGenreName`, `trackTimeMillis`, `trackNumber`, `trackCount`, `discNumber`, `discCount`
- **Content flags**: `trackExplicitness`, `collectionExplicitness`, `isStreamable`
- **Source**: `sourceUrl` (the exact API call made)

### Example Usage

```json
{
  "term": "radiohead",
  "entity": "musicTrack",
  "limit": 10,
  "country": "US"
}
```

### API Reference

- [iTunes Search API Documentation](https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/iTuneSearchAPI/)
- Base endpoint: `https://itunes.apple.com/search`

### Related Actors

- [Crossref Scholarly Works Fetcher](https://apify.com/brunofin/crossref-scholarly-works-fetcher) — academic paper metadata
- [GDELT Global News & Event Graph](https://apify.com/brunofin/gdelt-news-event-graph-fetcher) — real-time news monitoring

# Actor input Schema

## `term` (type: `string`):

Search query (artist name, song title, movie name, podcast, etc.).

## `entity` (type: `string`):

Type of media to search for. Options: musicTrack, album, artist, musicVideo, movie, podcast, audiobook, shortFilm, tvShow, software, ebook, all.

## `attribute` (type: `string`):

Which attribute to search by. Depends on entity type. Options: genreIndex, artistTerm, genreTerm, composerTerm, albumTerm, ratingIndex, songTerm, movieTerm, tvShowTerm, podcastTerm, audiobookTerm, authorTerm, ebookTerm, shortFilmTerm, softwareTerm, all.

## `limit` (type: `integer`):

Maximum number of results to return (1-200).

## `country` (type: `string`):

Two-letter country code for the store to search (e.g., US, GB, DE, JP).

## `media` (type: `string`):

Media type filter. Options: music, movie, podcast, audiobook, shortFilm, tvShow, software, ebook, all.

## Actor input object example

```json
{
  "term": "radiohead",
  "entity": "musicTrack",
  "attribute": "all",
  "limit": 50,
  "country": "US",
  "media": "all"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "term": "radiohead"
};

// Run the Actor and wait for it to finish
const run = await client.actor("brunofin/apple-itunes-media-fetcher").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "term": "radiohead" }

# Run the Actor and wait for it to finish
run = client.actor("brunofin/apple-itunes-media-fetcher").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "term": "radiohead"
}' |
apify call brunofin/apple-itunes-media-fetcher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brunofin/apple-itunes-media-fetcher"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dI9AE1wFOOpKQKI9r/builds/sd3W1vDoQWdxFJc25/openapi.json
