Catalog/music-key-signature

Music

Key signature for a key API

Returns the key signature for a major or minor key — the count and ordered list of sharps or flats, derived via the circle of fifths and relative-major mapping. Answers 'How many sharps does G major have?', 'What is the key signature of A minor?'.

Price$0.04per request
MethodPOST
Route/v1/music/key-signature
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
musickey-signaturesharpsflatscircle-of-fifthstheorymajorminornotation
API URLhttps://x402.hexl.dev/v1/music/key-signature
Integration docs
Example request
{
  "key": "G"
}
Example response
{
  "key": "G major",
  "relativeMajor": "G",
  "type": "sharps",
  "count": 1,
  "accidentals": [
    "F#"
  ],
  "signedCount": 1,
  "notation": "1 sharp: F#"
}
Input schema
{
  "type": "object",
  "required": [
    "key"
  ],
  "properties": {
    "key": {
      "type": "string",
      "examples": [
        "G",
        "F",
        "A"
      ]
    },
    "mode": {
      "type": "string",
      "examples": [
        "major",
        "minor"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}