Code Snippets

Please note that the following snippets are not production-ready and could/should be optimized.

Useful commands

AWS S3

Our infrastructure is using AWS S3 Buckets to store all your assets. In order for us to ingest your catalogue, you will need to interact with this bucket.

Once configured, you can use aws cli to queries your bucket. Please replace {YOUR_BUCKET_NAME} by the one configured for your organization.

List your delivery area:

$ aws s3 ls s3://{YOUR_BUCKET_NAME}/delivery/
                           PRE audio/
                           PRE mapping/
                           PRE metadata/

Upload an audio file to your bucket:

$ aws s3 cp {YOUR_LOCAL_FILE} s3://{YOUR_BUCKET_NAME}/delivery/audio/

Upload a metadata file to your bucket:

$ aws s3 cp {YOUR_LOCAL_FILE} s3://{YOUR_BUCKET_NAME}/delivery/metadata/

Please consult the official documentation to lean more about Amazon S3.

Useful queries

Our Web API provides you with a Generic Tracks Search Engine. By combining several parameters, you may use it for several use-cases:

Please note that all the following queries need to be authenticated by the usage of one of our Access Token.

Get statistics

By requesting the Tracks Search Engine with several parameters and a limit of 1 to reduce the amount of data resulted, we can easily read the field total_size that will give us the total amount of entries matching our parameters.

Get the total amount of tracks available in one of your catalogs:

curl --location --request GET 'https://api-v2.musimap.io/tracks?limit=1&catalog_id={YOUR_CATALOG_ID}'

Get the total amount of tracks that are not successfully analyzed (yet):

curl --location --request GET 'https://api-v2.musimap.io/tracks?limit=1&product_status_not=success'

Get the total amount of tracks available for a specific product (musimatch in this example):

curl --location --request GET 'https://api-v2.musimap.io/tracks?limit=1&product=musimatch&product_available=true'

Get the total amount of tracks successfully analyzed, but not available yet for a specific product:

curl --location --request GET 'https://api-v2.musimap.io/tracks?limit=1&product_status=success&product_version=v2.1&product=musimatch&product_available=false'