API reference / Collections

Find a track in your collections

GET/v1/collections/search

Matches title, original title, creator, tags and item notes against the tracks in your own collections. Each result lists the collections that hold the track. At most 50 results per page; cursor pages forward and stops at 1,000 results with capped true.

Needs an API key. Send it in the Authorization: Bearer header.

Get a key

Parameters

NameInTypeDescription
q requiredQuerystring Shortest: 2. Longest: 100
cursor optionalQuerystring
archived optionalQuerystringAlso search archived collections. One of: include

Responses

  • 200 OK.

    Schema CollectionSearchPage · Content: application/json

  • 400 The collection request is not valid.

    Schema Error · Content: application/json

    Error fields (8)
    NameTypeDescription
    error requiredstringA short code: missing_api_key, invalid_api_key, invalid_parameter, invalid_filter_for_kind, not_found, rate_limited, method_not_allowed, or internal_error.
    message requiredstringWhat went wrong, in plain words.
    parameter optionalstringOn invalid_parameter and invalid_filter_for_kind, the invalid parameter or field.
    invalid_values optionalarray of stringUnknown controlled filter ids.
    discovery optionalstringThe endpoint listing valid filter ids and labels.
    limit optionalstringOnly on rate_limited: which limit you hit. One of: minute, day, month
    retry_after optionalnumberOnly on rate_limited: seconds to wait before retrying.
    reset_at optionalstringOnly on rate_limited: when that limit resets, as an ISO 8601 UTC time.
  • 401 The API key is missing, not valid, or revoked.

    Schema Error · Content: application/json

    Error fields (8)
    NameTypeDescription
    error requiredstringA short code: missing_api_key, invalid_api_key, invalid_parameter, invalid_filter_for_kind, not_found, rate_limited, method_not_allowed, or internal_error.
    message requiredstringWhat went wrong, in plain words.
    parameter optionalstringOn invalid_parameter and invalid_filter_for_kind, the invalid parameter or field.
    invalid_values optionalarray of stringUnknown controlled filter ids.
    discovery optionalstringThe endpoint listing valid filter ids and labels.
    limit optionalstringOnly on rate_limited: which limit you hit. One of: minute, day, month
    retry_after optionalnumberOnly on rate_limited: seconds to wait before retrying.
    reset_at optionalstringOnly on rate_limited: when that limit resets, as an ISO 8601 UTC time.
  • 429 Over your plan's limit. Free accounts get 20 calls per minute and 300 calls per day. Pro accounts get 60 calls per minute and 20,000 calls per month (UTC). MCP and the API share one allowance per account. The Retry-After header gives the seconds to wait, up to 86,400, and the limit and reset_at fields in the body name the limit you hit and when it resets.

    Schema Error · Content: application/json

    Error fields (8)
    NameTypeDescription
    error requiredstringA short code: missing_api_key, invalid_api_key, invalid_parameter, invalid_filter_for_kind, not_found, rate_limited, method_not_allowed, or internal_error.
    message requiredstringWhat went wrong, in plain words.
    parameter optionalstringOn invalid_parameter and invalid_filter_for_kind, the invalid parameter or field.
    invalid_values optionalarray of stringUnknown controlled filter ids.
    discovery optionalstringThe endpoint listing valid filter ids and labels.
    limit optionalstringOnly on rate_limited: which limit you hit. One of: minute, day, month
    retry_after optionalnumberOnly on rate_limited: seconds to wait before retrying.
    reset_at optionalstringOnly on rate_limited: when that limit resets, as an ISO 8601 UTC time.
Request: GET /v1/collections/search
curl · Request, GET /v1/collections/search
curl "https://api.uncommonear.com/v1/collections/search?q=example&cursor=example&archived=include" \
  -H "Authorization: Bearer $UNCOMMON_EAR_API_KEY"
JavaScript · Request, GET /v1/collections/search
const url = "https://api.uncommonear.com/v1/collections/search?" + new URLSearchParams({ q: "example", cursor: "example", archived: "include" });
const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.UNCOMMON_EAR_API_KEY}` },
});
const data = await response.json();
console.log(response.status, data);
Python · Request, GET /v1/collections/search
import os
import requests

response = requests.get(
    "https://api.uncommonear.com/v1/collections/search",
    params={"q": "example", "cursor": "example", "archived": "include"},
    headers={"Authorization": "Bearer " + os.environ["UNCOMMON_EAR_API_KEY"]},
)
print(response.status_code, response.json())
JSON · 200 response
{
  "results": [
    {
      "track": "example",
      "title": "example",
      "artist": "example",
      "unavailable": true,
      "matched": "track",
      "collections": [
        {}
      ]
    }
  ],
  "cursor": "example",
  "more": true,
  "capped": true
}

Copy only. No request is sent from this page, so your key never goes into a web page. The samples read it from the UNCOMMON_EAR_API_KEY environment variable.