A library track describes an audio file that is analyzed with the available Cyanite.ai classifiers upon creation. Whenever we release or update a new model a library track can be reanalyzed.
On our API the GraphQL type that describes the data that can be queried is called
A library track is automatically created by uploading a new audio file into your library on the Cyanite Web App Library View.
All those library tracks created via the web app, as well as those created via the API can be fetched via the API.
In case no tracks were imported via the web app or the API before the library is empty. We recommend importing some tracks via the web app, for testing the GraphQL operations mentioned in this guide. The next guide will cover how library tracks can be imported via the API.
A paginated list of all
LibraryTracks can be retrieved via the
The Cyanite API uses cursor based pagination, which means that more items can be fetched by querying with the cursor of the last item of the previous page.
Query.libraryTracks field will always return the library tracks sorted by creation date descending.
first argument describes the amount of items that should be fetched. It is optional and cannot be set to any value higher than
50. If not provided the
first value is automatically set to
It is also possible to filter the library tracks by its title by using the
It is also possible to directly fetch a single
LibraryTrack via the
This is handy in a scenario where a system got notified by a webhook and data for that specific track should be retrieved.
Query.libraryTracks field returns a GraphQL union type with the name
LibraryTrackResult. The union describes the possible results that the field can return.
In case a track with the given id does not exist in the library, a
LibraryTrackNotFoundError is returned. Otherwise, the result will be a
The selection set on the GraphQL operation is quite small. We recommend selecting different fields for getting a better feel and overview of the available data.
In huge libraries duplicates may occur. The
Query.libraryTracks field allows searching for a specific track via the
SHA256 hash of the audio file. This allows checking whether a track already exists within the Cyanite.ai library in order to avoid uploading duplicates.
Most platforms and programming languages come with utilities for computing
SHA256 hashes from files.
Example Operation for searching tracks via SHA256 hash
You can get a better overview over the GrapHQL fields and types in our generated schema documentation.
The next guide will cover how to upload new library tracks via the API.