Catalog/music-interval

Music

Interval between two notes API

Identifies the musical interval between two notes — semitone count, interval name and shorthand (P5, M3, tritone) plus compound-interval handling and cents. Answers 'What interval is C4 to G4?', 'How many semitones from E to B?'.

Price$0.04per request
MethodPOST
Route/v1/music/interval
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
musicintervalsemitonestheoryharmonyperfect-fifthtritonenoteaudio
API URLhttps://x402.hexl.dev/v1/music/interval
Integration docs
Example request
{
  "note1": "C4",
  "note2": "G4"
}
Example response
{
  "note1": "C4",
  "note2": "G4",
  "semitones": 7,
  "absSemitones": 7,
  "octaves": 0,
  "simpleInterval": "perfect fifth",
  "simpleShorthand": "P5",
  "compound": false,
  "intervalName": "perfect fifth",
  "direction": "ascending",
  "centsEqualTemperament": 700
}
Input schema
{
  "type": "object",
  "required": [
    "note1",
    "note2"
  ],
  "properties": {
    "note1": {
      "type": "string",
      "examples": [
        "C4"
      ]
    },
    "note2": {
      "type": "string",
      "examples": [
        "G4"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}