# Pandora Service

Integration with the [Pandora Music](https://www.pandora.com) streaming platform, providing lookup and search functionality for artists, albums, and tracks.

## Supported Features

- ✅ URL Parsing
- ✅ Lookup by URL
- ✅ Search by Name
- ❌ Search by UPC
- ❌ Search by ISRC

## Limitations

- Only available in the US market.

## Link and ID Formats

Pandora URLs follow these patterns:

- Artist: `https://www.pandora.com/artist/{artist-name}/{artist-id}`
- Album: `https://www.pandora.com/artist/{artist-name}/{album-name}/{album-id}`
- Track: `https://www.pandora.com/artist/{artist-name}/{track-name}/{track-id}`

Pandora IDs always start with a prefix indicating type:

- `AR` - Artist ( e.g., `ARVt9qdlZ4g4fg9` )
- `AL` - Album ( e.g., `AL39b2ml7xPVm4c` )
- `TR` - Track (e.g., `TR123abc456def`)

Note that numeric IDs are used in internal API lookups
They start with `AL:[number]` for albums `AR:[number]` for artists and `TR:[number]` for tracks.

## API Documentation

The Pandora integration uses an internal API that is not publicly documented. This integration uses:

- **Base URL**: `https://www.pandora.com/api/`
- **Lookup Endpoint**: `v4/catalog/getDetails` (POST)
- **Search Endpoint**: `v3/sod/search` (POST)

### Authentication

Pandora's API requires minimal authentication headers:

- `x-csrftoken` header with any value (e.g., "foo")
- `cookie` header with matching CSRF token (e.g., "csrftoken=foo;")
- `user-agent` header to prevent request blocking
