# Search
URL: https://musicapi.com/docs/reference/search-catalog.md

`POST https://api.musicapi.com/public/search`

Section: Search and match the catalog.
Product: MusicAPI Core.
Auth: Basic, Token, DevToken, DocsSession (any one of them). Use Basic with your Client ID and Client Secret from your server only.

Searches the catalogues of one or more services for a track, an album or an artist. Needs no connected user. [Check which services return the ISRC](/docs/get-started/services-and-features).

## Request body

`application/json`, required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | yes | One of: track, album, artist. |
| `track` | string | no | Track title. |
| `artist` | string | no | Artist name. |
| `album` | string | no | Album title. |
| `sources` | string[] | yes | At least one search source. `GET /public/search/introspection` lists the valid values. |

## Response 200

ok

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tracks` | object[] | yes |  |
| `tracks[].source` | string | yes |  |
| `tracks[].status` | string | yes |  |
| `tracks[].data` | object | yes |  |
| `tracks[].data.externalId` | string | yes |  |
| `tracks[].data.name` | string | yes |  |
| `tracks[].data.artistNames` | string[] \| null | yes |  |
| `tracks[].data.albumName` | string \| null | yes |  |
| `tracks[].data.imageUrl` | string | yes |  |
| `tracks[].data.previewUrl` | string \| null | yes |  |
| `tracks[].data.isrc` | string | yes |  |
| `tracks[].data.duration` | number \| null | yes |  |
| `tracks[].data.url` | string | yes |  |
| `tracks[].type` | string | yes |  |

```json
{
  "tracks": [
    {
      "source": "spotify",
      "status": "success",
      "data": {
        "externalId": "5aszL9hl6SBzFNsOvw8u8w",
        "name": "Bezos I",
        "artistNames": [
          "Bo Burnham"
        ],
        "albumName": "INSIDE",
        "imageUrl": "https://i.scdn.co/image/ab67616d0000b27388fed14b936c38007a302413",
        "previewUrl": "string",
        "isrc": "",
        "duration": 58149,
        "url": "https://open.spotify.com/track/5aszL9hl6SBzFNsOvw8u8w"
      },
      "type": "track"
    }
  ]
}
```

## Example

```bash
curl -X POST "https://api.musicapi.com/public/search" \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"type":"track","track":"Bezos I","artist":"Bo Burnham","album":"INSIDE","sources":["spotify"]}'
```
