Developers

Maybe you're an artist who would like to let your fans create their own versions of some of your songs. Maybe you're a music teacher and have music exercises for your students. Maybe you have built a web-based drum machine or synthesizer. Use the APIs below to easily integrate your web content with Soundtrap.

Import API

The import API provides various methods for you to link your content to Soundtrap. This lets your visitors easily edit your audio and midi content with a single click.

audio1

GET https://www.soundtrap.com/publicapi/import/audio1/
Parameter Default Value Description
url (required) The full url to the audio file to import. The url must be publicly accessible and be served with proper CORS headers, see below. To make your link work in all browsers it is recommended that you use .wav files. Alternatively, you can specify many formats by providing several urls separated by comma. A recommendation in this case is to provide files in the formats .mp4 (aac) and .ogg (vorbis).
title   The title of the new project.
bpm 120 The tempo.
key C The key, specified as a pitch (e.g. C, Bb or G#), optionally followed by m for minor.

The audio1 method allows you to create a link to open up an existing audio file in Soundtrap Studio. You can link directly to the api method in standard html <a> or <button> elements.

Response

A redirect is returned and the Soundtrap studio will open. This requires a supported browser, see below.

Example

Edit on Soundtrap

midi1

GET https://www.soundtrap.com/publicapi/import/midi1/
Parameter Default Value Description
url (required) The full url to the midi file to import. The url must be publicly accessible and be served with proper CORS headers, see below.
title   The title of the new project.

The midi1 method allows you to create a link to open up an existing midi file in Soundtrap Studio. You can link directly to the api method in standard html <a> or <button> elements.

Response

A redirect is returned and the Soundtrap studio will open. This requires a supported browser, see below.

Example

Edit on Soundtrap

soundcloud1

GET https://www.soundtrap.com/publicapi/import/soundcloud1/
Parameter Default Value Description
url (required) The full url to the Soundcloud track to import. The track must be public and downloadable. The url should begin with https://api.soundcloud.com/tracks/

The soundcloud1 method allows you to create a link to open up an existing Soundcloud track in Soundtrap Studio. You can link directly to the api method in standard html <a> or <button> elements.

Response

A redirect is returned and the Soundtrap studio will open. This requires a supported browser, see below.

Example

Edit on Soundtrap

Soundcloud Player with Edit Button

You can add an edit button to your Soundcloud creations by using our widget tool. More info here.

 

Additional Information

CORS headers

To allow cross-site access to your website content from Soundtrap, you need to add CORS (Cross-Origin Resource Sharing) headers to your web server. These headers will give Soundtrap permission to load content from your domain.

Apache

Example Apache configuration, see also this link. To add the CORS authorization to the header using Apache, simply add the following line inside either the <Directory>, <Location>, <Files> or <VirtualHost> sections of your server config (usually located in a *.conf file, such as httpd.conf or apache.conf), or within a .htaccess file:

Header set Access-Control-Allow-Origin "https://www.soundtrap.com"

Other Web Servers

For other web servers such as nginx and PHP, please click here.

 

Supported Browsers

If you link to Soundtrap Studio using any of the api methods above, please note that Soundtrap Studio uses some of the newer HTML5 browser features such as web audio. For this reason, your users will be required to use the latest version of Google Chrome, Safari or Microsoft Edge.

{{item.user.location | uppercase}}