### Freesound API Simple Search Examples Source: https://freesound.org/docs/api/resources_apiv2 Illustrates basic search queries to the Freesound API. These examples show how to search for sounds using keywords, pagination, and exclusion of terms. ```http https://freesound.org/apiv2/search/?query=cars https://freesound.org/apiv2/search/?query=piano&page=2 https://freesound.org/apiv2/search/?query=bass%20-drum https://freesound.org/apiv2/search/?query="bass%20drum"%20-double ``` -------------------------------- ### Authentication - API Key Example Source: https://freesound.org/docs/api/overview Example of how to authenticate API calls using an API key with the text search resource. ```APIDOC ## GET /apiv2/search/text/ ### Description This endpoint allows you to search for sounds using text-based queries and filter results with various parameters. Authentication is required using an API key. ### Method GET ### Endpoint https://freesound.org/apiv2/search/text/ ### Query Parameters - **query** (string) - Required - The search terms to query for sounds. - **token** (string) - Required - Your Freesound API key for authentication. ### Request Example ```bash curl "https://freesound.org/apiv2/search/text/?query=piano&token=YOUR_API_KEY" ``` ### Response #### Success Response (200) - **sounds** (array) - A list of sound objects matching the query. - **next** (string) - URL for the next page of results. - **previous** (string) - URL for the previous page of results. #### Response Example ```json { "sounds": [ { "id": 12345, "name": "Grand Piano Chord", "url": "https://freesound.org/sounds/12345/", "previews": { "preview-hq-ogg": "https://freesound.org/media/previews/123/12345_preview_hq.ogg", "preview-hq-mp3": "https://freesound.org/media/previews/123/12345_preview_hq.mp3" } } ], "next": "https://freesound.org/apiv2/search/text/?page=2&query=piano&token=YOUR_API_KEY", "previous": null } ``` ``` -------------------------------- ### Get Pack Instance (GET) Source: https://freesound.org/docs/api/resources_apiv2 Retrieves information about a specific sound pack. Returns a dictionary containing pack details such as ID, URL, description, creation date, name, creator's username, number of sounds, and download count. ```HTTP GET /apiv2/packs// ``` -------------------------------- ### GET /api/sounds//analysis/start_time Source: https://freesound.org/docs/api/analysis_docs Retrieves the start time of the sound in seconds, marking when it rises above silence. ```APIDOC ## GET /api/sounds//analysis/start_time ### Description Retrieves the moment at which sound begins in seconds, i.e., when the audio signal first rises above silence. This is determined using silence detection algorithms. ### Method GET ### Endpoint /api/sounds//analysis/start_time ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/start_time ``` ### Response #### Success Response (200) - **start_time** (numeric) - The start time of the sound in seconds. #### Response Example ```json { "start_time": 0.52 } ``` ``` -------------------------------- ### Get User Packs (GET) Source: https://freesound.org/docs/api/resources_apiv2 Retrieves a paginated list of sound packs created by a specific Freesound user. Supports pagination parameters 'page' and 'page_size'. ```HTTP GET /apiv2/users//packs/ Example: https://freesound.org/apiv2/users/reinsamba/packs/ https://freesound.org/apiv2/users/reinsamba/packs/?page=2 ``` -------------------------------- ### Get Start Time Analysis from Freesound API Source: https://freesound.org/docs/api/analysis_docs Identifies the start time of the audible sound in an audio signal, i.e., when it rises above silence. It returns a numeric value in seconds. ```curl curl https://freesound.org/api/sounds//analysis/start_time ``` -------------------------------- ### Get User Information (GET) Source: https://freesound.org/docs/api/resources_apiv2 Retrieves information about a specific Freesound user. Returns a dictionary containing user details such as username, about text, homepage, avatar, join date, and counts for sounds, packs, posts, and comments. ```HTTP GET /apiv2/users// Example: https://freesound.org/apiv2/users/reinsamba/ https://freesound.org/apiv2/users/Freed/ ``` -------------------------------- ### Freesound API Token Authentication using Authorization header Source: https://freesound.org/docs/api/authentication This example shows how to authenticate Freesound API calls by including the API key in the 'Authorization' header as a 'Token' type. This is an alternative to using a GET parameter and is often preferred for security reasons. It requires a valid API key. ```curl curl -H "Authorization: Token YOUR_API_KEY" "https://freesound.org/apiv2/search/text/?query=piano" ``` -------------------------------- ### GET /apiv2/sounds//similar/ Source: https://freesound.org/docs/api/resources_apiv2 Retrieves sounds similar to a given target sound. ```APIDOC ## GET /apiv2/sounds//similar/ ### Description This resource allows the retrieval of sounds similar to a given sound target, based on various similarity spaces. It functions similarly to the `similar_to` parameter in the Search resource, with the sound ID specified in the URI. ### Method GET ### Endpoint /apiv2/sounds//similar/ ### Query Parameters - **similarity_space** (string) - Optional - Indicates the similarity space used for the search. If not defined, the default similarity space is used. - **fields** (string) - Optional - A comma-separated list of sound properties to include in the response for each similar sound. Can include any field from the Sound Instance resource plus an additional `score` field. Default: `id,name,tags,username,license`. - **page** (integer) - Optional - The page number of the results to return. Default: 1. - **page_size** (integer) - Optional - The number of sounds to return per page. Default: 15, Maximum: 150. ### Request Example ``` https://freesound.org/apiv2/sounds/1234/similar/ ``` ### Response #### Success Response (200) A sound list containing sounds similar to the target sound. The structure is the same as the Response (sound list) from other resources, with additional parameters like `page`, `page_size`, and `fields` applying. #### Response Example ```json { "count": 100, "next": "...", "previous": null, "results": [ { "id": 5678, "name": "Similar Sound 1", "tags": ["ambient"], "username": "user456", "license": "Creative Commons Sampling+", "score": 0.85 }, { "id": 9101, "name": "Similar Sound 2", "tags": ["drone"], "username": "user789", "license": "Attribution 4.0 International", "score": 0.72 } ] } ``` ``` -------------------------------- ### Using Analysis File as Target (Freesound API - POST Request) Source: https://freesound.org/docs/api/resources_apiv2 Provides an example of how to use the 'analysis_file' parameter in a POST request to the Freesound API. This allows sorting search results by similarity to a sound analyzed locally using Essentia. ```http POST /rest/v2/sounds/search/content/?target=&token= HTTP/1.1 Host: www.freesound.org Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="analysis_file"; filename=".json" Content-Type: application/json {...} ------WebKitFormBoundary7MA4YWxkTrZu0gW-- ``` -------------------------------- ### Search by Freesound Sound ID or Essentia Analysis File (Freesound API) Source: https://freesound.org/docs/api/resources_apiv2 This example shows how to use the `target` parameter to search for a specific Freesound sound by its ID or to use an Essentia analysis file as a target for similarity searches. The latter requires a POST request with the analysis file uploaded. ```url https://freesound.org/apiv2/search/content/?target=1234 curl -X POST -H "Authorization: Token {{your_api_key}}" -F analysis_file=@"/path/to/your_file.json" 'https://freesound.org/apiv2/search/content/' ``` -------------------------------- ### Bookmark Sound using cURL Source: https://freesound.org/docs/api/resources_apiv2 This snippet demonstrates how to bookmark a sound using cURL. It shows examples of a simple bookmark and a bookmark with a specified category. Authentication is required via an OAuth2 access token. ```curl curl -X POST -H "Authorization: Bearer {{access_token}}" --data "name=Classic thunderstorm" 'https://freesound.org/apiv2/sounds/2523/bookmark/' ``` ```curl curl -X POST -H "Authorization: Bearer {{access_token}}" --data "name=Nice loop&category=Nice loops" 'https://freesound.org/apiv2/sounds/1234/bookmark/' ``` -------------------------------- ### Combined Search Examples Source: https://freesound.org/docs/api/resources_apiv2 Demonstrates various ways to perform combined searches using different parameter combinations, including target descriptors, textual filters, and multidimensional descriptors. ```url https://freesound.org/apiv2/search/combined/?target=rhythm.bpm:120&filter=tag:loop ``` ```url https://freesound.org/apiv2/search/combined/?filter=tag:loop&descriptors_filter=rhythm.bpm:%5B119%20TO%20121%5D ``` ```url https://freesound.org/apiv2/search/combined/?descriptors_filter=tonal.key_key:"A"%20tonal.key_scale:"major"&filter=tag:chord ``` ```url https://freesound.org/apiv2/search/combined/?query=music&fields=id,analysis&descriptors=lowlevel.mfcc.mean&descriptors_filter=lowlevel.mfcc.mean%5B1%5D:%5B17%20TO%2020%5D%20AND%20lowlevel.mfcc.mean%5B4%5D:%5B0%20TO%2020%5D ``` -------------------------------- ### Search by Target Descriptor Value (Freesound API) Source: https://freesound.org/docs/api/resources_apiv2 This snippet demonstrates using the `target` parameter to find sounds matching specific descriptor values. It includes examples for exact matches, combining multiple targets with AND, and using multidimensional descriptors. ```url https://freesound.org/apiv2/search/content/?target=lowlevel.pitch.mean:220 https://freesound.org/apiv2/search/content/?target=lowlevel.pitch.mean:220%20AND%20lowlevel.pitch.var:0 https://freesound.org/apiv2/search/content/?target=sfx.tristimulus.mean:0,1,0&fields=id,analysis&descriptors=sfx.tristimulus.mean ``` -------------------------------- ### Combine Numerical and Non-Numerical Descriptors (Freesound API) Source: https://freesound.org/docs/api/resources_apiv2 This example shows how to combine both numerical and non-numerical descriptors within a single `descriptors_filter` query. This allows for highly specific searches by filtering on attributes like key, scale, and strength simultaneously. ```url https://freesound.org/apiv2/search/content/?descriptors_filter=tonal.key_key:"C"%20tonal.key_scale="major"%20tonal.key_strength:[0.8%20TO%20*] ``` -------------------------------- ### GET /api/sounds//analysis/spectral_complexity Source: https://freesound.org/docs/api/analysis_docs Retrieves the spectral complexity of a sound. ```APIDOC ## GET /api/sounds//analysis/spectral_complexity ### Description Retrieves the spectral complexity of the audio signal. ### Method GET ### Endpoint /api/sounds//analysis/spectral_complexity ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **spectral_complexity** (numeric) - The computed spectral complexity value. ``` -------------------------------- ### Sorting Search Results by Pitch Descriptor (Freesound API) Source: https://freesound.org/docs/api/resources_apiv2 Demonstrates how to use the 'target' parameter to sort Freesound API search results by specific content-based descriptors. This example shows sorting by mean pitch and pitch variance. ```text target=lowlevel.pitch.mean:220 target=lowlevel.pitch.mean:220 lowlevel.pitch.var:0 ``` -------------------------------- ### GET /api/sounds//analysis/onset_times Source: https://freesound.org/docs/api/analysis_docs Retrieves the timestamps (in seconds) for all detected onsets in the audio signal. ```APIDOC ## GET /api/sounds//analysis/onset_times ### Description Timestamps for the detected onsets in the audio signal in seconds, which can vary according to the amount of onsets (computed by the onset_count descriptor). ### Method GET ### Endpoint /api/sounds//analysis/onset_times ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **onset_times** (array[numeric]) - An array of timestamps in seconds for each detected onset. #### Response Example ```json { "onset_times": [0.12, 0.55, 1.23, 2.01] } ``` ``` -------------------------------- ### GET /apiv2/sounds//analysis/ Source: https://freesound.org/docs/api/resources_apiv2 Retrieves all content-based audio analysis descriptors for a given sound. ```APIDOC ## GET /apiv2/sounds//analysis/ ### Description This resource allows the retrieval of all audio analysis information of a sound, including content-based descriptors and similarity vectors. Unlike the `fields` parameter in other endpoints, this resource returns all descriptors without filtering options. ### Method GET ### Endpoint /apiv2/sounds//analysis/ ### Query Parameters - **fields** (string) - Optional - A comma-separated list of descriptor names to retrieve. If not specified, all available descriptors are returned. Example: `fields=tristimulus` or `fields=mfcc,tristimulus,warmth`. ### Request Example ``` https://freesound.org/apiv2/sounds/1234/analysis/ ``` ### Response #### Success Response (200) A dictionary containing the values of all content-based descriptors for the sound. The specific fields returned depend on the `fields` query parameter. #### Response Example ```json { "tonality_confidence": 0.9, "tristimulus": [0.1, 0.5, 0.4], "warmth": 0.7, "zero_crossing_rate": 0.05, "mfcc": ["..."], "bpm": 120.0 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/pitch_min Source: https://freesound.org/docs/api/analysis_docs Retrieves the minimum fundamental frequency observed in a sound. ```APIDOC ## GET /api/sounds//analysis/pitch_min ### Description Retrieves the minimum fundamental frequency observed throughout the audio signal. ### Method GET ### Endpoint /api/sounds//analysis/pitch_min ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **pitch_min** (numeric) - The minimum fundamental frequency in Hz. ``` -------------------------------- ### GET /api/sounds//analysis/onset_count Source: https://freesound.org/docs/api/analysis_docs Retrieves the number of detected onsets in the audio signal. ```APIDOC ## GET /api/sounds//analysis/onset_count ### Description Number of detected onsets in the audio signal. ### Method GET ### Endpoint /api/sounds//analysis/onset_count ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **onset_count** (integer) - The total number of detected onsets. #### Response Example ```json { "onset_count": 50 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/tonality Source: https://freesound.org/docs/api/analysis_docs Retrieves the estimated key (tonality) of the audio signal. ```APIDOC ## GET /api/sounds//analysis/tonality ### Description Retrieves the key (tonality) estimated by a key detection algorithm. The key name includes the root note of the scale and the scale mode (e.g., "C minor", "F# major"). ### Method GET ### Endpoint /api/sounds//analysis/tonality ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/tonality ``` ### Response #### Success Response (200) - **tonality** (string) - The estimated key of the audio signal (e.g., "C minor"). #### Response Example ```json { "tonality": "A major" } ``` ``` -------------------------------- ### GET /api/sounds//analysis/hpcp_entropy Source: https://freesound.org/docs/api/analysis_docs Retrieves the HPCP entropy of a sound, measuring the uniformity of the pitch-class distribution. ```APIDOC ## GET /api/sounds//analysis/hpcp_entropy ### Description Retrieves the HPCP entropy of a sound, measuring the uniformity of the pitch-class distribution. It is computed as the Shannon entropy of the HPCP. ### Method GET ### Endpoint /api/sounds//analysis/hpcp_entropy ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **hpcp_entropy** (numeric) - The computed HPCP entropy value. ``` -------------------------------- ### Get Similar Sounds Source: https://freesound.org/docs/api/resources_apiv2 Retrieve a list of sounds similar to a given sound. Supports pagination and filtering by specific fields. ```APIDOC ## GET /apiv2/sounds//similar/ ### Description Retrieves a paginated list of sounds that are similar to the specified sound. ### Method GET ### Endpoint /apiv2/sounds/{sound_id}/similar/ ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **fields** (string) - Optional - A comma-separated list of fields to include in the response. - **filter** (string) - Optional - Filtering criteria for similar sounds. Example: `spectral_centroid:[80 TO 100] note_midi:60` ``` -------------------------------- ### GET /api/sounds//analysis/sharpness Source: https://freesound.org/docs/api/analysis_docs Retrieves the sharpness of the audio signal, describing its perceived spectral brightness. ```APIDOC ## GET /api/sounds//analysis/sharpness ### Description Retrieves the sharpness of the audio signal. Sharpness is a psychoacoustic measure related to the spectral distribution of energy, often associated with high-frequency content. ### Method GET ### Endpoint /api/sounds//analysis/sharpness ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/sharpness ``` ### Response #### Success Response (200) - **sharpness** (numeric) - The sharpness of the audio signal. Values range from 0 to 100. #### Response Example ```json { "sharpness": 75.2 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/log_attack_time Source: https://freesound.org/docs/api/analysis_docs Retrieves the logarithmic attack time of a sound's envelope. ```APIDOC ## GET /api/sounds//analysis/log_attack_time ### Description Retrieves the logarithmic (base 10) attack time of the audio signal’s envelope. The attack time is defined as the duration from when the sound becomes perceptually audible to when it reaches its maximum intensity. ### Method GET ### Endpoint /api/sounds//analysis/log_attack_time ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **log_attack_time** (numeric) - The computed logarithmic attack time. ``` -------------------------------- ### Freesound API Search with Field Selection Source: https://freesound.org/docs/api/resources_apiv2 Provides examples of how to request specific fields in the Freesound API search results. This helps in reducing the amount of data transferred by only retrieving necessary information like name, previews, spectral centroid, pitch, URI, and onset times. ```http https://freesound.org/apiv2/search/?query=alarm&fields=name,previews https://freesound.org/apiv2/search/?query=alarm&fields=name,spectral_centroid,pitch https://freesound.org/apiv2/search/?query=loop&fields=uri,onset_times ``` -------------------------------- ### GET /api/sounds//analysis/roughness Source: https://freesound.org/docs/api/analysis_docs Retrieves the roughness of the audio signal, quantifying its sonic texture irregularity. ```APIDOC ## GET /api/sounds//analysis/roughness ### Description Retrieves the roughness of the audio signal. Roughness is a measure of the uneven or irregular sonic texture of a sound. ### Method GET ### Endpoint /api/sounds//analysis/roughness ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/roughness ``` ### Response #### Success Response (200) - **roughness** (numeric) - The roughness of the audio signal. Values range from 0 to 100. #### Response Example ```json { "roughness": 50.5 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/warmth Source: https://freesound.org/docs/api/analysis_docs Retrieves the warmth of the audio signal, related to its perceived tonal quality. ```APIDOC ## GET /api/sounds//analysis/warmth ### Description Retrieves the warmth of the audio signal. Warmth is a psychoacoustic descriptor related to the sensation analogous to that caused by a physical increase in temperature, often associated with the presence of lower-mid frequencies. ### Method GET ### Endpoint /api/sounds//analysis/warmth ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/warmth ``` ### Response #### Success Response (200) - **warmth** (numeric) - The warmth of the audio signal. Values range from 0 to 100. #### Response Example ```json { "warmth": 65.0 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/note_midi Source: https://freesound.org/docs/api/analysis_docs Retrieves the MIDI value corresponding to the estimated note of the audio signal. ```APIDOC ## GET /api/sounds//analysis/note_midi ### Description MIDI value corresponding to the estimated note (computed by the note_name descriptor). ### Method GET ### Endpoint /api/sounds//analysis/note_midi ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **note_midi** (integer) - The MIDI value of the estimated note. #### Response Example ```json { "note_midi": 69 } ``` ``` -------------------------------- ### Sorting Search Results by Multidimensional Descriptor (Freesound API) Source: https://freesound.org/docs/api/resources_apiv2 Illustrates using the 'target' parameter with a multidimensional descriptor to sort Freesound API search results. This example targets the 'sfx.tristimulus.mean' descriptor. ```text target=sfx.tristimulus.mean:0,1,0 ``` -------------------------------- ### Filter by Numerical Descriptors (Freesound API) Source: https://freesound.org/docs/api/resources_apiv2 This snippet demonstrates how to use the `descriptors_filter` parameter with numerical audio descriptors. It shows examples of exact matches, range-based filtering, and combining multiple numerical descriptor filters using AND logic. Multidimensional descriptors can be filtered by specifying a dimension index. ```url https://freesound.org/apiv2/search/content/?descriptors_filter=lowlevel.pitch.mean:[219.9%20TO%20220.1] https://freesound.org/apiv2/search/content/?descriptors_filter=lowlevel.pitch.mean:[219.9%20TO%20220.1]%20AND%20lowlevel.pitch_salience.mean:[0.6%20TO%20*] https://freesound.org/apiv2/search/content/?descriptors_filter=lowlevel.mfcc.mean[0]:[-1124%20TO%20-1121] https://freesound.org/apiv2/search/content/?descriptors_filter=lowlevel.mfcc.mean[1]:[17%20TO%2020]%20AND%20lowlevel.mfcc.mean[4]:[0%20TO%2020] ``` -------------------------------- ### GET /api/sounds//analysis/pitch_salience Source: https://freesound.org/docs/api/analysis_docs Retrieves the pitch salience of a sound, indicating the prominence of the pitch sensation. ```APIDOC ## GET /api/sounds//analysis/pitch_salience ### Description Retrieves the pitch salience of a sound. Pitch salience is calculated as the ratio of the highest auto-correlation value of the spectrum to the non-shifted auto-correlation value. Unpitched sounds and pure tones have values close to 0. ### Method GET ### Endpoint /api/sounds//analysis/pitch_salience ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/pitch_salience ``` ### Response #### Success Response (200) - **pitch_salience** (numeric) - The pitch salience of the audio signal. Values range from 0 to 1. #### Response Example ```json { "pitch_salience": 0.85 } ``` ``` -------------------------------- ### List Sounds in a Pack (API) Source: https://freesound.org/docs/api/resources_apiv2 Get a list of sounds contained within a specific sound pack. Supports pagination and field selection for the response. ```HTTP https://freesound.org/apiv2/packs/9678/sounds/ https://freesound.org/apiv2/packs/9678/sounds/?fields=id,name ``` -------------------------------- ### GET /apiv2/sounds/pending_uploads/ Source: https://freesound.org/docs/api/resources_apiv2 Retrieves a list of audio files uploaded by the user that have not yet been described, processed, or moderated. This endpoint requires OAuth2 authentication. ```APIDOC ## GET /apiv2/sounds/pending_uploads/ ### Description Retrieves a list of audio files uploaded by the Freesound user logged in using OAuth2 that have not yet been described, processed or moderated. This method requires OAuth2 authentication. ### Method GET ### Endpoint /apiv2/sounds/pending_uploads/ ### Parameters None ### Request Example ```bash curl -H "Authorization: Bearer {{access_token}}" 'https://freesound.org/apiv2/sounds/pending_uploads/' ``` ### Response #### Success Response (200) - **pending_description** (array of strings) - A list of filenames pending description. - **pending_processing** (array of objects) - A list of sound objects pending processing. Each object includes `id`, `name`, `tags`, `description`, `created`, `license`, and `processing_state`. - **pending_moderation** (array of objects) - A list of sound objects pending moderation. Each object includes `id`, `name`, `tags`, `description`, `created`, `license`, and `images`. #### Response Example ```json { "pending_description": [ "", "", ... ], "pending_processing": [ { "id": "", "name": "", "tags": "", "description": "", "created": "", "license": "", "processing_state": "Failed" }, ... ], "pending_moderation": [ { "id": "", "name": "", "tags": "", "description": "", "created": "", "license": "", "images": { "waveform_url": "", "spectrogram_url": "" } }, ... ] } ``` ``` -------------------------------- ### GET /api/sounds//analysis/chord_progression Source: https://freesound.org/docs/api/analysis_docs Retrieves the estimated chord progression for a given sound, represented as a time-varying sequence of chord labels. ```APIDOC ## GET /api/sounds//analysis/chord_progression ### Description Retrieves the chords estimated from the harmonic pitch class profiles (HPCPs) across the audio signal. It finds the best-matching major or minor triad and outputs a time-varying chord sequence as a sequence of labels (e.g. A#, Bm). Note, chords are major if no minor symbol. ### Method GET ### Endpoint /api/sounds//analysis/chord_progression ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The ID of the sound to analyze. ### Response #### Success Response (200) - **chord_progression** (array[string]) - A time-varying sequence of detected chord labels (e.g., ["C", "G", "Am", "F"]). #### Response Example ```json { "chord_progression": [ "C", "G", "Am", "F" ] } ``` ``` -------------------------------- ### GET /api/sounds//analysis/pitch Source: https://freesound.org/docs/api/analysis_docs Retrieves the mean fundamental frequency (pitch) of a sound, computed using the YinFFT algorithm. ```APIDOC ## GET /api/sounds//analysis/pitch ### Description Retrieves the mean fundamental frequency (pitch) of a sound, computed using the YinFFT algorithm. This descriptor indicates the average pitch of the audio signal. ### Method GET ### Endpoint /api/sounds//analysis/pitch ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/pitch ``` ### Response #### Success Response (200) - **pitch** (numeric) - The mean fundamental frequency of the audio signal. Values range from 0 to 25000. #### Response Example ```json { "pitch": 440.0 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/brightness Source: https://freesound.org/docs/api/analysis_docs Retrieves the brightness of the audio signal. Brightness indicates clarity, vibrancy, and the presence of high-pitched elements. ```APIDOC ## GET /api/sounds//analysis/brightness ### Description Brightness of the audio signal. A bright sound is one that is clear/vibrant and/or contains significant high-pitched elements. ### Method GET ### Endpoint /api/sounds//analysis/brightness ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **brightness** (numeric) - The brightness value of the audio signal, ranging from 0 to 100. #### Response Example ```json { "brightness": 60.2 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/note_confidence Source: https://freesound.org/docs/api/analysis_docs Retrieves the confidence score for the estimated note name and MIDI value of the audio signal. ```APIDOC ## GET /api/sounds//analysis/note_confidence ### Description Confidence score on how reliable the note name/MIDI estimation is. ### Method GET ### Endpoint /api/sounds//analysis/note_confidence ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **note_confidence** (numeric) - The confidence score for the note estimation, ranging from 0 to 1. #### Response Example ```json { "note_confidence": 0.92 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/hpcp_crest Source: https://freesound.org/docs/api/analysis_docs Retrieves the HPCP crest of a sound, indicating the dominance of the strongest pitch class compared to the rest. ```APIDOC ## GET /api/sounds//analysis/hpcp_crest ### Description Retrieves the HPCP crest of a sound, indicating the dominance of the strongest pitch class (crest) compared to the rest. It is computed as the ratio between the maximum HPCP value and the mean HPCP value. ### Method GET ### Endpoint /api/sounds//analysis/hpcp_crest ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **hpcp_crest** (numeric) - The computed HPCP crest value. ``` -------------------------------- ### Get Pack Information (API) Source: https://freesound.org/docs/api/resources_apiv2 Retrieve details about a specific sound pack using its ID. This is a simple GET request to the Freesound API. ```HTTP https://freesound.org/apiv2/packs/9678/ ``` -------------------------------- ### GET /api/sounds//analysis/bpm Source: https://freesound.org/docs/api/analysis_docs Retrieves the estimated BPM (beats per minute) of the audio signal using a beat tracking algorithm. ```APIDOC ## GET /api/sounds//analysis/bpm ### Description BPM value of the audio estimated by beat tracking algorithm. ### Method GET ### Endpoint /api/sounds//analysis/bpm ### Parameters #### Path Parameters - **sound_id** (integer) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **bpm** (integer) - The estimated BPM value of the audio signal. #### Response Example ```json { "bpm": 120 } ``` ``` -------------------------------- ### Numeric Range Filtering in Freesound API Source: https://freesound.org/docs/api/resources_apiv2 Demonstrates how to apply range filters for numeric or integer fields in the Freesound API. This is particularly useful for float values where exact matches are uncommon. The syntax uses '[start TO end]' with '*' representing open-ended ranges. ```text filter=filtername:[start TO end] filter=filtername:[* TO end] filter=filtername:[start TO *] ``` -------------------------------- ### Get Pending Uploads (cURL) Source: https://freesound.org/docs/api/resources_apiv2 This cURL command retrieves a list of audio files uploaded by the Freesound user that are pending description, processing, or moderation. It requires an OAuth2 access token for authentication. ```bash curl -H "Authorization: Bearer {{access_token}}" 'https://freesound.org/apiv2/sounds/pending_uploads/' ``` -------------------------------- ### Get User Sounds (GET) Source: https://freesound.org/docs/api/resources_apiv2 Retrieves a list of sounds uploaded by a specific Freesound user. Supports pagination and filtering parameters like 'page', 'page_size', and 'fields'. ```HTTP GET /apiv2/users//sounds/ Example: https://freesound.org/apiv2/users/Jovica/sounds/ https://freesound.org/apiv2/users/Jovica/sounds/?page=2 https://freesound.org/apiv2/users/Jovica/sounds/?fields=id,bitdepth,type,samplerate ``` -------------------------------- ### Describe a Sound (cURL) Source: https://freesound.org/docs/api/resources_apiv2 This cURL command demonstrates how to describe an audio file using the Freesound API. It requires the upload filename, tags, description, category, and license. An access token is necessary for authentication. ```bash curl -X POST -H "Authorization: Bearer {{access_token}}" --data "upload_filename=your_file.wav&tags=field-recording birds nature h4n&description=This sound was recorded...
bla bla bla...&bst_category=fx-a&license=Attribution" 'https://freesound.org/apiv2/sounds/describe/' ``` ```bash curl -X POST -H "Authorization: Bearer {{access_token}}" --data "upload_filename=your_file.wav&name=A cool bird sound&tags=field-recording birds nature h4n&description=This sound was recorded...
bla bla bla...&bst_category=fx-a&license=Attribution" 'https://freesound.org/apiv2/sounds/describe/' ``` ```bash curl -X POST -H "Authorization: Bearer {{access_token}}" --data "upload_filename=your_file.wav&name=A cool bird sound&tags=field-recording birds nature h4n&description=This sound was recorded...
bla bla bla...&bst_category=fx-a&license=Attribution&pack=A birds pack&geotag=2.145677,3.22345,14" 'https://freesound.org/apiv2/sounds/describe/' ``` -------------------------------- ### Freesound API Content Search Endpoints (Deprecated) Source: https://freesound.org/docs/api/resources_apiv2 Lists the deprecated GET and POST endpoints for content-based sound searching in the Freesound API v2. The documentation notes that this resource is deprecated and will be removed, with similar functionality to be provided by the main Search resource. ```http GET /apiv2/search/content/ POST /apiv2/search/content/ ``` -------------------------------- ### GET /api/sounds//analysis/hpcp Source: https://freesound.org/docs/api/analysis_docs Retrieves the Harmonic Pitch Class Profile (HPCP) of a sound, representing the energy distribution across 36 pitch classes. ```APIDOC ## GET /api/sounds//analysis/hpcp ### Description Retrieves the Harmonic Pitch Class Profile (HPCP) of a sound, representing the energy distribution across 36 pitch classes (3 subdivisions per semitone). ### Method GET ### Endpoint /api/sounds//analysis/hpcp ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **hpcp** (array[numeric]) - An array of 36 numeric values representing the HPCP. ``` -------------------------------- ### Get Sharpness Analysis from Freesound API Source: https://freesound.org/docs/api/analysis_docs Quantifies the sharpness of an audio signal, relating to its perceived brightness. It returns a numeric value between 0 and 100. ```curl curl https://freesound.org/api/sounds//analysis/sharpness ``` -------------------------------- ### Upload and Describe Sound - cURL Source: https://freesound.org/docs/api/resources_apiv2 Uploads an audio file and provides descriptive metadata simultaneously. This includes tags, a description, category, and license. This method streamlines the process of adding new sounds with full details. ```shell curl -X POST -H "Authorization: Bearer {{access_token}}" -F audiofile=@"/path/to/your_file.wav" -F "tags=field-recording birds nature h4n" -F "description=This sound was recorded...
bla bla bla..." -F "bst_category=fx-a" -F "license=Attribution" 'https://freesound.org/apiv2/sounds/upload/' ``` -------------------------------- ### Freesound API v2 Overview Source: https://freesound.org/docs/api/index Provides an overview of the Freesound API v2, its capabilities, and notes on versioning. It covers accessing users, packs, and sounds, along with advanced features like content analysis and user interactions. ```APIDOC ## Freesound API v2 Overview ### Description This section provides a general overview of the Freesound API v2. It details the API's capabilities, including browsing, searching, and retrieving information about Freesound users, packs, and sounds. It also highlights advanced features such as content analysis for finding similar sounds and extracting audio features, as well as user interaction functionalities like uploading, commenting, rating, and bookmarking sounds. ### Method N/A (Overview document) ### Endpoint N/A (Overview document) ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### GET /api/sounds//analysis/pitch_var Source: https://freesound.org/docs/api/analysis_docs Retrieves the variance of the fundamental frequency of a sound. ```APIDOC ## GET /api/sounds//analysis/pitch_var ### Description Retrieves the variance of the fundamental frequency of the audio signal. ### Method GET ### Endpoint /api/sounds//analysis/pitch_var ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Response #### Success Response (200) - **pitch_var** (numeric) - The variance of the fundamental frequency. ``` -------------------------------- ### GET /api/sounds//analysis/silence_rate Source: https://freesound.org/docs/api/analysis_docs Retrieves the proportion of silence in the audio signal. ```APIDOC ## GET /api/sounds//analysis/silence_rate ### Description Retrieves the amount of silence in the audio signal, computed by the fraction of frames with instant power below 30dB. This descriptor indicates the proportion of the audio that is considered silent. ### Method GET ### Endpoint /api/sounds//analysis/silence_rate ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/silence_rate ``` ### Response #### Success Response (200) - **silence_rate** (numeric) - The mean proportion of silence in the audio signal. Values range from 0 to 1. #### Response Example ```json { "silence_rate": 0.15 } ``` ``` -------------------------------- ### GET /api/sounds//analysis/reverbness Source: https://freesound.org/docs/api/analysis_docs Determines whether the audio signal is reverberated or not. ```APIDOC ## GET /api/sounds//analysis/reverbness ### Description Determines whether the audio signal is reverberated or not. This descriptor provides a boolean value indicating the presence of reverberation. ### Method GET ### Endpoint /api/sounds//analysis/reverbness ### Parameters #### Path Parameters - **sound_id** (string) - Required - The unique identifier for the sound. ### Request Example ```bash curl https://freesound.org/api/sounds//analysis/reverbness ``` ### Response #### Success Response (200) - **reverbness** (boolean) - True if the signal is reverberated, false otherwise. #### Response Example ```json { "reverbness": true } ``` ```