# App Store Top Charts (`appstore.top_charts`)

Top free or top paid iPhone apps in a country's App Store, ranked.

- **Route:** `POST /v1/run/appstore.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:** p50 628 ms · p95 628 ms · p99 628 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `country` | string | no | "us" | Two-letter country code of the store |
| `chart` | string | no | "top-free" | Chart |
| `limit` | integer | no | 25 | Apps to return |

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

| Field | Meaning |
|---|---|
| `results` | rank, id, name, artist (developer), genres, artwork, url. |
| `updated_at` | When Apple last updated the chart. |
| `count` | Apps returned. |

## Example

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

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('appstore.top_charts', {'country': 'us', 'chart': 'top-free', 'limit': 10})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run appstore.top_charts '{"country":"us","chart":"top-free","limit":10}'
```

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