Back to Journal
November 26, 2026
Developers & API

Audio to Sheet Music API: Transcribe MP3 to MusicXML and MIDI in Code

Audio to Sheet Music API: Transcribe MP3 to MusicXML and MIDI in Code

If you are building a music app, a practice tool, a teaching platform or an AI agent, you eventually need one thing: turn a recording into notes a program can read. The ScoreFlip API does that over plain HTTPS. You send an audio link, you get back MusicXML and MIDI you can open in MuseScore, Finale, Sibelius or Dorico, or feed into your own code.

This guide takes you from zero to a working transcription in curl, Python and Node.js. Everything here is also in the API reference; the OpenAPI 3.1 file is at /scoreflip/developers/openapi.json.

What you get back

InputOutput
MP3, WAV, M4A or similar audio (public https link, base64 or multipart upload)MusicXML, MIDI, and a JSON summary with tempo, key and time signature
Same audio, stem separation endpointSeparate vocals, drums, bass and other stems
A photo or scan of one printed pageMusicXML (optical music recognition)

Jobs are asynchronous: you start a job, poll its status, then download the result. Results are kept for 7 days.

How billing works (no surprises)

The API is prepaid and credit-based, with no free tier. Credits never expire, there is no subscription, and a failed job is refunded automatically. Every job returns credits_charged so you always know what it cost, and you can set max_credits on any request to refuse a job that would cost more than you intended. Live prices are published at the pricing endpoint, so this page does not repeat numbers that can change.

Credits and API keys are managed inside the ScoreFlip app under Settings → Developer API. You can buy a standard pack or any custom number of credits.

1. Transcribe with curl

bash
curl -X POST https://api.scoreflipml.roovemusic.com/v1/transcriptions \
  -H "Authorization: Bearer $SCOREFLIP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/my-recording.mp3", "mode": "auto", "max_credits": 10}'

The response is 202 Accepted with a job id and the credits charged. Poll it, then fetch the result:

bash
curl https://api.scoreflipml.roovemusic.com/v1/jobs/JOB_ID \
  -H "Authorization: Bearer $SCOREFLIP_API_KEY"

curl "https://api.scoreflipml.roovemusic.com/v1/jobs/JOB_ID/result?format=musicxml" \
  -H "Authorization: Bearer $SCOREFLIP_API_KEY" -o score.musicxml

Use format=midi for a MIDI file or format=json for tempo, key and time signature.

2. The same thing in Python

python
import os, time, uuid, requests

API = "https://api.scoreflipml.roovemusic.com"
H = {"Authorization": f"Bearer {os.environ['SCOREFLIP_API_KEY']}"}

job = requests.post(
    f"{API}/v1/transcriptions",
    headers={**H, "Idempotency-Key": str(uuid.uuid4())},
    json={"url": "https://example.com/my-recording.mp3", "max_credits": 10},
)
job.raise_for_status()
job = job.json()

while job["status"] in ("queued", "processing"):
    time.sleep(3)
    job = requests.get(f"{API}/v1/jobs/{job['id']}", headers=H).json()

if job["status"] == "done":
    xml = requests.get(f"{API}/v1/jobs/{job['id']}/result",
                       params={"format": "musicxml"}, headers=H)
    open("score.musicxml", "wb").write(xml.content)
else:
    print("failed (credits refunded):", job["error"]["message"])

3. The same thing in Node.js

javascript
const API = "https://api.scoreflipml.roovemusic.com";
const headers = { Authorization: `Bearer ${process.env.SCOREFLIP_API_KEY}` };

let res = await fetch(`${API}/v1/transcriptions`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({ url: "https://example.com/my-recording.mp3", max_credits: 10 }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
let job = await res.json();

while (job.status === "queued" || job.status === "processing") {
  await new Promise((r) => setTimeout(r, 3000));
  job = await (await fetch(`${API}/v1/jobs/${job.id}`, { headers })).json();
}
if (job.status === "done") {
  const xml = await fetch(`${API}/v1/jobs/${job.id}/result?format=musicxml`, { headers });
  console.log(await xml.text());
}

Safe to retry: idempotency

Network calls fail. Send an Idempotency-Key header (any unique string) and a retried request returns the same job instead of charging you twice. Keys are remembered for 24 hours.

Tips for cleaner scores

  • Split first for busy mixes. If the recording has drums and vocals, run the stems endpoint and transcribe the piano, bass or guitar stem. Cleaner input means a cleaner score. See what works best for audio to sheet music.
  • Pass only what you need. A shorter clip costs fewer credits, because audio is charged per started minute.
  • Cap spend in agents. Always set max_credits when a script or AI agent is choosing the input.

Security notes

Keys are shown once, stored only as hashes on our side, and can be revoked in the app at any time. The URL fetcher accepts public https links only and blocks private network addresses. Read the full authentication guide.

Next steps

  1. Read the quickstart.
  2. Open Settings → Developer API in the ScoreFlip app to create a key and add credits.
  3. Building with an AI assistant? See the MCP server guide.

Enjoyed this deep dive?

Explore more articles on notation scanning, electric keyboards, and gamified music practice in our journal.

Explore All Articles