# Classical Music API
> The classical-music repertoire as an API — powered by Open Opus, an open catalogue of classical composers and their works. Search composers by name or browse them by musical epoch (Medieval, Renaissance, Baroque, Classical, Romantic and beyond), getting each composer's full name, epoch and birth/death years; then list a composer's works, optionally filtered by genre — orchestral, chamber, keyboard, stage, vocal or opera. From Bach and Mozart to Beethoven's 44 orchestral works, it turns the canon of classical music into a clean search-and-browse API. A classical-music repertoire reference — distinct from commercial music catalogues of tracks, artists and albums. Ideal for classical-music, education, concert-programming, streaming and media applications. Open data from Open Opus (CC-BY-SA / CC0).

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/classical-api/..."
```

## Pricing
- **Free** (Free) — 2,230 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 44,500 calls/Mo, 8 req/s
- **Pro** ($21/Mo) — 223,000 calls/Mo, 20 req/s
- **Mega** ($56/Mo) — 820,000 calls/Mo, 50 req/s

## Endpoints

### Classical Music

#### `GET /v1/composers` — Search composers by name or epoch

**Parameters:**
- `q` (query, optional, string) — Composer name to search Example: `mozart`
- `epoch` (query, optional, string) — Epoch (Baroque, Classical, Romantic, …)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/classical-api/v1/composers?q=mozart"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "query": "mozart",
        "composers": [
            {
                "id": "196",
                "name": "Wolfgang Amadeus Mozart",
                "epoch": "Classical",
                "portrait": "https://assets.openopus.org/portraits/21459195-1568084925.jpg",
                "birth_year": 1756,
                "death_year": 1791
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:56.522Z",
        "request_id": "f1e47b5e-c97b-4274-a99f-696175dd23a0"
    },
    "status": "ok",
    "message": "Composers retrieved",
    "success": true
}
```

#### `GET /v1/works` — A composer's works (optionally by genre)

**Parameters:**
- `composer` (query, optional, string) — Composer id (from /v1/composers) Example: `145`
- `genre` (query, optional, string) — Genre (Orchestral, Chamber, Opera, …)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/classical-api/v1/works?composer=145"
```

**Response:**
```json
{
    "data": {
        "count": 344,
        "genre": "all",
        "works": [
            {
                "id": "16300",
                "genre": "Chamber",
                "title": "Cello Sonata no. 4 in C major, op. 102, no. 1",
                "subtitle": null
            },
            {
                "id": "16260",
                "genre": "Chamber",
                "title": "Grosse Fuge, op. 133",
                "subtitle": "For string quartet"
            },
            {
                "id": "16322",
                "genre": "Orchestral",
                "title": "Leonore Overture no. 3, op. 72b",
                "subtitle": null
            },
            {
                "id": "16382",
                "genre": "Vocal",
                "title": "Missa Solemnis, op. 123",
                "subtitle": null
            },
            {
                "id": "16170",
                "genre": "Orchestral",
                "title": "Piano Concerto no. 3 in C minor, op. 37",
                "subtitle": null
            },
            {
                "id": "16286",
                "genre": "Orchestral",
                "title": "Piano Concerto no. 4 in G major, op. 58",
                "subtitle": null
            },
            {
                "id": "16218",
                "genre": "Orchestral",
                "title": "Piano Concerto no. 5 in E flat major, op. 73, \"Emperor\"",
                "subtitle": null
            },
            {
                "id
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Epochs, genres & notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/classical-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Open Opus is an open catalogue of classical composers and their works. /v1/composers?q=beethoven searches composers by name, or /v1/composers?epoch=Baroque lists composers of a musical epoch (Medieval, Renaissance, Baroque, Classical, Early Romantic, Romantic, Late Romantic, 20th Century, Post-War, 21st Century) — each with id, full name, epoch and birth/death years. /v1/works?composer=145 lists that composer's works (composer ids come from /v1/composers; 145 = Beethoven), optionally filtered by genre=Orchestral|Chamber|Keyboard|Stage|Vocal|Opera — each work with its id, title, subtitle and genre. Data from Open Opus (CC-BY-SA / CC0). A classical-music repertoire reference — distinct from commercial music catalogues of tracks, artists and albums. Ideal for classical-music, education, concert and media applications.",
        "epochs": [
            "Medieval",
            "Renaissance",
            "Baroque",
            "Classical",
            "Early Romantic",
            "Romantic",
            "Late Romantic",
            "20th Century",
            "Post-War",
            "21st Century"
        ],
        "genres": [
            "Keyboard",
            "Orchestral",
            "Chamber",
            "Stage",
            "Vocal",
            "Opera"
        ],
        "source": "Open Opus — open classical-music catalogue (openopus.org)",
        "endpoints": [
            "/v1/composers",
            "/v1/works",
            "/v1
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/classical-api
OpenAPI spec: https://www.oanor.com/api/classical-api/openapi.json
