# StableMusic - Top Tracks by Tag

> StableMusic - Top Tracks by Tag is a paid API for AI agents from stablemusic.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns the top tracks associated with a specific music tag (genre, mood, era, etc.) via Last.fm data

## Facts

- Endpoint: POST https://stablemusic.dev/api/tags/top-tracks
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stablemusic-top-tracks-by-tag-fcbe6f70
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pDGSP6M9Us-Zsspn4mf8h

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stablemusic-top-tracks-by-tag-fcbe6f70 -d '<json body>'
```

Example prompt: What are the top tracks tagged as 'jazz' on Last.fm? Give me the most popular ones so I can build a playlist.

## When to prefer this

Use this endpoint when you need to discover the most popular tracks associated with a specific music genre, mood, era, or any Last.fm-style tag. Ideal for building tag-based playlists, powering music recommendation features, or exploring what songs define a particular musical category. Prefer this over general music search when you want ranked, crowd-sourced popularity data tied to a specific tag.

## Known failure modes

- Invalid or unrecognized tag returns empty results or 404
- Tag with no associated tracks returns empty list
- Network timeout or upstream Last.fm API unavailability
- Payment failure via x402 protocol blocks the request
- Malformed POST body returns 400 error

## How this service works

Pay-per-request Last.fm music discovery for tags, tracks, artists, albums, charts, and country charts.

## Output

A ranked list of top tracks associated with the given music tag, including track names, artist names, and play count or ranking data sourced from Last.fm.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "tag": {
   "type": "string",
   "minLength": 1,
   "description": "Last.fm tag, genre, or category."
  },
  "page": {
   "type": "integer",
   "default": 1,
   "maximum": 9007199254740991,
   "minimum": 1,
   "description": "Last.fm page number. Defaults to 1."
  },
  "limit": {
   "type": "integer",
   "default": 10,
   "maximum": 100,
   "minimum": 1,
   "description": "Number of results to return. Defaults to 10, max 100."
  },
  "include_raw": {
   "type": "boolean",
   "default": false,
   "description": "Include the upstream Last.fm response payload."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stablemusic-top-tracks-by-tag-fcbe6f70/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stablemusic.dev](https://www.zero.xyz/host/stablemusic.dev/llms.txt)
