# Apple Music Top Charts (`apple_music.top_charts`)

Most-played songs or albums on Apple Music in a country, ranked.

- **Route:** `POST /v1/run/apple_music.top_charts`
- **Price:** $0.00085 per request ($0.85 per 1,000) · `cost_usd` on every response
- **Source:** Apple iTunes Search API + App Store RSS (`apple`) · failover: no
- **Measured latency:** not enough calls measured yet
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `country` | string | no | "us" | Two-letter country code of the store |
| `type` | string | no | "songs" | Chart |
| `limit` | integer | no | 25 | Entries to return |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `results` | rank, name, artist, released_at, genres, artwork, url. |
| `updated_at` | When Apple last updated the chart. |
| `count` | Entries returned. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/apple_music.top_charts \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"us","type":"songs","limit":10}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('apple_music.top_charts', {'country': 'us', 'type': 'songs', 'limit': 10})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run apple_music.top_charts '{"country":"us","type":"songs","limit":10}'
```

Quote first (free, validates input): `POST /v1/quote/apple_music.top_charts` with the same body.
