How to download Looperman loops with Python

You need an account and a logged-in session. The MP3 preview on a listing page is public; the WAV comes from a /getfiles/ link that only exists for a logged-in visitor, and every download counts against a per-account quota. LoopHaven opens that session on your own machine and streams the resulting file.

Verified against the live site on 16 November 2026 · LoopHaven 0.2.0

There are two different files, and only one is free

PreviewDownload
FormatMP3WAV for loops, MP3 for acapellas
Needs a sessionNoYes
Counts against quotaNoYes
Where it comes fromdata-mp3 on the card/getfiles/ on the detail page
LoopHaven route/api/stream/preview/api/download/audio/…

The preview is enough to audition material and decide. The WAV is what you actually load into a DAW, and it is the part that has rules attached.

The symptom that wastes a day: zero download links

A loop's detail page contains 16 links to /getfiles/ when you are logged in — the loop itself plus every recommended loop rendered below it. Fetched without a session, the same page contains zero.

So when a scraper reports “no download link on the page”, the cause is almost never a markup change or a quota. It is an expired cookie. The three symptoms — health check says logged in, download button appears, download fails — are one wrong predicate. Checking a session properly is worth reading before you debug anything else.

Working flow

pip install "loophaven[mcp]"
python -m uvicorn loophaven.api.app:app --host 127.0.0.1 --port 8000

# open a session (prompts locally; the password is never stored)
haven login

# what a download would give you — free, spends no quota
curl "http://127.0.0.1:8000/api/download/info/loop/436799"

# then take the file, in one step
haven download --id 436799
haven download --id 24926 --kind acapella --out vocals.mp3

haven download asks the info route first and prints the format, size and availability, so a refusal costs nothing. It exits 2 with the reason when there is no session or the quota is spent, and it never retries a 429.

The info route exists so you can decide before spending anything:

{
  "id": "436799", "kind": "loop",
  "logged_in": true, "requires_login": true, "download_available": true,
  "expected_format": "wav", "duration_seconds": 13,
  "title": "Lil Uzi Vert arp type loop", "author": "NiemiroMTS",
  "bpm": 140, "key": "Cm", "size_hint": "2.31 MB",
  "license": "https://www.looperman.com/help/terms"
}

Search, then fetch, in Python

import pathlib, re, requests

BASE = "http://127.0.0.1:8000"

found = requests.get(f"{BASE}/api/search", params={
    "genre": "Trap", "bpm": 140, "key": "Cm", "limit": 3,
}, timeout=30).json()

for item in found["loops"]:
    print(item["id"], item["bpm"], item["key"], item["title"])

loop_id = found["loops"][0]["id"]

info = requests.get(f"{BASE}/api/download/info/loop/{loop_id}", timeout=30).json()
if not info["download_available"]:
    raise SystemExit(f"not available (logged_in={info['logged_in']})")

audio = requests.get(f"{BASE}/api/download/audio/loop/{loop_id}", timeout=120)
audio.raise_for_status()

stem = re.sub(r"[^A-Za-z0-9 ._-]+", "_", info["title"]).strip()
out = pathlib.Path("loops")
out.mkdir(exist_ok=True)
path = out / f"{stem}.{info['expected_format']}"
path.write_bytes(audio.content)
print(info["size_hint"], "->", path)

Check the headers before you trust the file

A download that silently succeeds is the failure mode worth guarding against: a quota page or a login page returned with 200 would otherwise be saved as .wav and break later, in the DAW, with no trace of where it came from.

HTTP 200
Content-Type: audio/wav
X-Audio-Format: wav
Content-Disposition: attachment; filename="looperman-l-8513679-0436799-....wav"

Several loops at once

POST /api/download/zip builds a personal pack of 2–4 loops, with a README.txt recalling the licence situation. Any file that fails is written into the ZIP as ERROR_<id>.txt with the reason, rather than silently substituted with a different format.

curl -X POST "http://127.0.0.1:8000/api/download/zip" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["434657", "434373"], "format": "wav", "filename": "pack.zip"}' \
  -o pack.zip

Four loops is the practical ceiling because the quota is per account. This is a sampling tool, not a mirroring tool.

What you may do with the file

The code is MIT; the audio is not. Loops belong to the people who uploaded them and are offered under Looperman's terms, which allow use inside a derivative work but not redistribution as-is. The licence field returned by the API is a quotation of what the page says, not legal advice.

Next: what a 429 means, or the filter reference to narrow a search before you download anything.