Skip to content

ryanpunwasi/semitone-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 

Repository files navigation

🎺 Semitone API

About

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 id
  • octave_id - the octave, which ranges from 1-5
  • letter - the letter notation, which ranges from A-G
  • accidental - the accidental, which can be flat, sharp, or natural
  • src - the source, which is a hyperlink to the audio of the note

Guide

How To Use

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

List of Endpoints

Exceptions

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.