Chirp Audio API

The Chirp Audio API can generate an MP3/WAV file containing any suitable payload. The payload can be encoded using any of the available licences.

Payloads

A Chirp payload is an array of bytes of a maximum length determined by the licence. For the audio API, payloads must be represented as a hexadecimal string. For example

[0, 1, 2, 3]  ->  00010203

[42, 100, 255]  ->  2a64ff

Licences

A list of available licences is available in the Chirp Admin Centre. The licence specification can also be found here, for example

48 bits [max] payload, and 2.529 seconds [max] duration.

For the audio API, all you need is the name of the licence.

Authentication

For authentication, an application key / secret should be used as the username / password using Basic Auth. This can be retrieved from the Chirp Admin Centre. Here is an example using cURL.

curl https://audio.chirp.io/v3/default -u <key>:<secret> -o chirp.mp3

In a web browser, you will be prompted to enter your credentials by the default Basic Auth pop up. Enter your application key / secret into the fields for username / password.

GET https://audio.chirp.io/v3/default

This has mixed support but credentials can also be passed in the URL like so

GET https://< key >:< secret >@audio.chirp.io/v3/default

API Reference

The Audio API is hosted at audio.chirp.io, and has the following endpoints.

audio.chirp.io/v3/default

Contains a random payload using the default licence for the application

audio.chirp.io/v3/ultrasonic

Contains a random payload using the ultrasonic licence

audio.chirp.io/v3/standard/2a64ff

Contains a specific payload of [42, 100, 255] using the standard licence


The Audio API returns MP3 files by default, but can also return WAV files.

audio.chirp.io/v3/default/68656c6c6f.wav

Returns a WAV file containing a specific payload using the default licence

The Audio API will also return a wav file if the Accept header is set to audio/wav


The Audio API can also return some info on the specified licence, including the duration of a chirp in seconds, and the maximum payload length.

audio.chirp.io/v3/default/info

Returns the duration and max payload length of a random payload using the default licence.

audio.chirp.io/v3/default/2a64ff/info

Returns the duration and max payload length of a random payload using the default licence.

Postman Example

You can download a Postman collection which highlights the features of the Audio API here Audio API for Postman

We recommend using Insomnia REST client, a fantastic alternative to Postman, which allows you to preview the audio directly in the app.

Note: These example requests will require you to fill in the basic auth credentials. Fill in the username / password with your application key / secret.