# Compare a portable listener profile with Brendan’s canonical tracks

Read-only bounded structured query. The UTF-8 request body is limited to 32768 bytes, is not retained, and returns grounded canonical IDs with reason codes rather than a compatibility percentage.

Operation: intersectMusicTaste
POST /api/music/intersections.json

Access: anonymous. Automatic retries: none. Redirects: manual. Request body limit: 32768 bytes.
Default timeout: 30 seconds. Response limit: 16 MiB. Pagination is opt-in and bounded; an exhausted bound reports incomplete execution.

[HTML reference](/developers/api/intersectMusicTaste) · [Authoritative schemas](/api/openapi.json)

## Wire contract

```json
{
  "operationId": "intersectMusicTaste",
  "summary": "Compare a portable listener profile with Brendan’s canonical tracks",
  "description": "Read-only bounded structured query. The UTF-8 request body is limited to 32768 bytes, is not retained, and returns grounded canonical IDs with reason codes rather than a compatibility percentage.",
  "tags": [
    "Music"
  ],
  "parameters": [
    {
      "name": "API-Version",
      "in": "header",
      "required": false,
      "description": "Header-based API version selection. Omit it, send an empty value, or send 1.0.0; surrounding whitespace is ignored.",
      "schema": {
        "type": "string",
        "pattern": "^[ \\t]*(1\\.0\\.0)?[ \\t]*$",
        "default": "1.0.0"
      }
    },
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "Accepted for clients that attach a key uniformly. GET, HEAD, and OPTIONS are already safe and intrinsically idempotent, so read responses are not stored in an idempotency replay cache.",
      "schema": {
        "type": "string"
      }
    }
  ],
  "x-idempotency": "read-only-structured-query",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MusicIntersectionRequestV1"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Grounded music intersection result",
      "headers": {
        "Content-Usage": {
          "description": "IETF AIPREF usage preferences for this public content",
          "schema": {
            "type": "string",
            "examples": [
              "train-ai=y, search=y"
            ]
          }
        },
        "Content-Signal": {
          "description": "Compatibility AI usage preferences for deployed crawlers",
          "schema": {
            "type": "string",
            "examples": [
              "ai-train=yes, search=yes, ai-input=yes"
            ]
          }
        },
        "API-Version": {
          "description": "Selected public REST contract version",
          "schema": {
            "type": "string",
            "enum": [
              "1.0.0"
            ]
          }
        },
        "RateLimit-Policy": {
          "description": "Public REST quota policy: 1000 Worker requests per 60 seconds for each source and Cloudflare location",
          "schema": {
            "type": "string"
          }
        },
        "RateLimit-Limit": {
          "description": "Compatibility form of the current public REST request limit",
          "schema": {
            "type": "integer",
            "enum": [
              1000
            ]
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MusicIntersectionResultV1"
          }
        }
      }
    },
    "400": {
      "description": "Invalid profile or request",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "413": {
      "description": "Request exceeds the 32 KiB limit",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "415": {
      "description": "Content-Type is not application/json",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "429": {
      "description": "Public REST request limit exceeded",
      "headers": {
        "Retry-After": {
          "description": "Seconds before the request should be retried",
          "schema": {
            "type": "integer",
            "enum": [
              60
            ]
          }
        },
        "RateLimit": {
          "description": "Current quota state for the exhausted public-rest policy",
          "schema": {
            "type": "string"
          }
        },
        "Content-Usage": {
          "description": "IETF AIPREF usage preferences for this public content",
          "schema": {
            "type": "string",
            "examples": [
              "train-ai=y, search=y"
            ]
          }
        },
        "Content-Signal": {
          "description": "Compatibility AI usage preferences for deployed crawlers",
          "schema": {
            "type": "string",
            "examples": [
              "ai-train=yes, search=yes, ai-input=yes"
            ]
          }
        },
        "API-Version": {
          "description": "Selected public REST contract version",
          "schema": {
            "type": "string",
            "enum": [
              "1.0.0"
            ]
          }
        },
        "RateLimit-Policy": {
          "description": "Public REST quota policy: 1000 Worker requests per 60 seconds for each source and Cloudflare location",
          "schema": {
            "type": "string"
          }
        },
        "RateLimit-Limit": {
          "description": "Compatibility form of the current public REST request limit",
          "schema": {
            "type": "integer",
            "enum": [
              1000
            ]
          }
        }
      },
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "503": {
      "description": "Intersection service unavailable",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    }
  }
}
```

## Synthetic examples

### curl

```bash
curl --fail-with-body --max-time 30 --max-filesize 16777216 --request POST 'https://irvinebroque.com/api/music/intersections.json' --header 'Accept: application/json' --header 'Content-Type: application/json' --data-binary @request.json
```

### TypeScript

```typescript
import { PublicApi } from '@irvinebroque/public-api';
const api = new PublicApi();
const result = await api.music.intersect({
  "body": {
    "profile": {
      "schemaVersion": "1",
      "music": {
        "artists": [],
        "recordings": [],
        "albums": [],
        "genres": [],
        "notes": []
      }
    }
  }
});
console.log(result.status, result.headers.get('content-type')); // Keep transient capabilities in memory.
```

### CLI

```bash
irvinebroque music intersect --body-file request.json
```

### request.json

```json
{
  "profile": {
    "schemaVersion": "1",
    "music": {
      "artists": [],
      "recordings": [],
      "albums": [],
      "genres": [],
      "notes": []
    }
  }
}
```
