Semitone API is a REST API that serves a total of sixty musical notes in five different octaves from the Western diatonic scale. This includes the notes A through G, as well as their accidentals.
Responses are in JSON format. Each note is represented as an object with the following properties:
id
- a unique idoctave_id
- the octave, which ranges from 1-5letter
- the letter notation, which ranges from A-Gaccidental
- the accidental, which can be flat, sharp, or naturalsrc
- the source, which is a hyperlink to the audio of the note
Making your first REST API call is easy and can be done from your browser.
REST calls are made up of:
- Base URL. Example
https://semitone-api.onrender.com
- Endpoint. Example
/notes
- Get all notes (grouped by octave)
/notes
- Get all octaves
/octaves
- Get all notes in a specific octave
/notes/octaves/{octave}
- Get a specific note
/notes/{octave}/{letter}/{accidental}
Requests for the notes C flat (C♭) and B sharp (B♯) will result in a 404: Not Found. This is because these notes belong to an octave that is different from the octave specified in the request. For example, the request /notes/3/C/flat
is requesting a note from the third octave. However, C flat in octave 3 is equivalent to B sharp in octave 2.
If the accidental for a note is not specified, the natural variation will be returned. For example, a request to the endpoint /notes/3/C
will return C natural.