Skip to content

API overview

Aurral provides a JSON HTTP API. The web interface uses this API. You can also use the API for scripts, dashboards, and homepage widgets.

Open Settings > System. Copy the API key. Send the key in the X-Api-Key header:

Terminal window
curl --fail \
--header "X-Api-Key: YOUR_API_KEY" \
https://aurral.example.com/api/library/artists

Aurral also accepts the api_key query parameter:

Terminal window
curl --fail \
"https://aurral.example.com/api/library/recent?api_key=YOUR_API_KEY"

Use the header. A browser can save URLs in its history. A reverse proxy can save URLs in its access logs.

The API key replaces a login session token. You do not need to call the login endpoint first. The key currently gives administrator access. It does not have read-only access.

Keep the key in a secret store. If your integration needs read access, make only GET requests. After you rotate the key, the old key does not operate.

Do not put the key in public browser JavaScript. A server-side widget or same-origin proxy keeps it out of visitors’ browsers.

EndpointPurposeParameters
GET /api/health/liveMinimal liveness checkNone
GET /api/healthAurral, library, discovery, and system statusNone
GET /api/library/artistsLibrary artistslimit (1-10000), offset
GET /api/library/artists/:mbidOne library artistMusicBrainz artist ID in the path
GET /api/library/albumsAlbums for an artistRequired artistId
GET /api/library/albums/:idOne library albumLidarr album ID in the path
GET /api/library/tracksTracks for an albumalbumId or releaseGroupMbid
GET /api/library/recent20 most recently added artistsNone
GET /api/library/recent-releasesRecent missing releasesNone
GET /api/requestsCurrent artist and album requestsOptional refresh=true
GET /api/library/downloads/status/allAll current download statesNone
GET /api/searchSearch artists, albums, or tagsRequired q. Optional scope, limit, and offset

See the endpoint reference for the complete current route index.

This request gets five recently added artists. The key stays on the server:

const response = await fetch(`${process.env.AURRAL_URL}/api/library/artists?limit=5`, {
headers: { "X-Api-Key": process.env.AURRAL_API_KEY },
});
if (!response.ok) throw new Error(`Aurral returned ${response.status}`);
const artists = await response.json();

If a browser loads Aurral from another origin, set CORS_ORIGIN. Use commas to separate each permitted origin. By default, Aurral does not permit cross-origin requests.

The current CORS preflight allows the Content-Type and Authorization headers. It does not allow the X-Api-Key header. For a cross-origin browser widget, use a server-side proxy. When you use the api_key query parameter, you do not need a custom header. However, browser history and access logs can reveal the key.

  • For a successful request, the route returns a JSON object or array.
  • For an error, the route returns JSON with an error field. Some errors also have a message or code field.
  • If authentication is invalid or not present, Aurral returns 401.
  • If a valid account does not have the necessary permission, Aurral returns 403.
  • Aurral limits each client to 5,000 API requests in each 15-minute period.
  • The API key does not have a separate permission or read-only scope.

The API key gives access to administration routes and routes that change data. Before you give the key to a third-party integration, read the endpoint reference.