Skip to main content API Wrapper

Project description

xeno-canto API Wrapper

xeno-canto-py is an API wrapper designed to help users easily download recordings and associated information.

Originally created to aid in data collection and filtering for the training of machine learning models.


Use the package manager pip to install xeno-canto-py, or copy and paste the file into your working directory.

pip install xenocanto


get_json and get_mp3 can be used to retrieve the JSON file and recordings from a query. Queries must be made according to the conventions detailed on the API search tips page found here.

The following commands will retrieve the query information for the genus Otis through get_json and then the recordings through get_mp3. Both functions will return a list of file paths to the newly saved files for further use if required.

import xenocanto

json_list = xenocanto.get_json(['gen:Otis'])
mp3_list = xenocanto.get_mp3(json_list)

get_rec calls get_json with the provided query and immediately calls get_mp3 afterwards.

The following command will produce the same result as above.

import xenocanto


This will generate two folders, queries and recordings which will contain the JSON files with query data and recordings as MP3 files respectively.


  • Add filtering of recordings folders (mainly by quality and background species)
  • Add basic pre-processing abilities (file conversion, re-sampling, etc.) on a as-needed basis
  • Add entrypoints for easier use

I am always open to suggestions for features!


All pull requests are welcome! If any issues are found, please do not hesitate to bring them to my attention.


Thank you to the team at and all its contributors for putting together such an amazing database.



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for xeno-canto, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size xeno_canto-1.0.1-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size xeno-canto-1.0.1.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page