A high-performance Python Scraper, RESTful API (FastAPI), Python SDK, and CLI for Kevin MacLeod's 1,440+ track Incompetech catalog.
Automated metadata enrichment, direct MP3 streaming/download links, ISRC tracking, and official Creative Commons Attribution 4.0 (CC BY 4.0) credit generator.
Key Features β’ Licensing & Credits β’ Installation β’ REST API Reference β’ Python SDK β’ CLI β’ Author & Credits
- π Zero-Bottleneck ETL Scraper: Ingests and normalizes the full master catalog (~1,443 tracks) directly from Incompetech's authoritative endpoints without hitting Cloudflare/rate limits.
- π― Enriched Metadata: Resolves numeric genre IDs into official genre titles (24 genres), maps album collections and categories, parses multi-mood tags (feels), and converts durations into integer seconds for precise numerical range queries.
- π Official CC BY 4.0 Credit Generator: Instantly produces Kevin MacLeod's official attribution blocks ready for copy-paste in Plain Text, Markdown, and HTML formats (supports both single-track and bulk multi-track productions).
- π§ Direct High-Quality MP3 Streams: Resolves direct audio URLs on Incompetech's servers with full HTTP byte-range seeking support (ideal for HTML5
<audio>, podcasts, video editors, and audio pipelines). - β‘ Asynchronous REST API: Powered by FastAPI with auto-generated interactive OpenAPI/Swagger UI (
/docs) and ReDoc (/redoc). - π¦ Dual-Mode Python SDK (
client.py): Seamlessly imports into video automation pipelines (MoviePy, FFmpeg bots, YouTube generation scripts) in Local Direct Mode (zero latency, no HTTP server needed) or Remote HTTP Mode. - π οΈ Feature-Packed CLI (
cli.py): Search tracks, inspect detailed metadata, copy credits, download MP3s, and calculate commercial license fees directly from the terminal. - π Dual Format Export: Automatically dumps the complete dataset to
data/catalog_enriched.json(~2.9 MB) anddata/catalog_enriched.csv(~700 KB) for analytics and spreadsheet processing.
flowchart TD
subgraph Incompetech_Source ["π Incompetech.com Master Endpoints"]
A[pieces.json<br>1,443 tracks]
B[genre.json<br>24 genres]
C[collections.json<br>50 collections]
D[mp3-royaltyfree/<br>Direct MP3 Files]
end
subgraph ETL_Scraper ["βοΈ Scraper & Enrichment Engine (scraper.py)"]
E[Data Normalizer]
F[Duration Parser to Seconds]
G[Genre & Album Mapper]
H[CC BY 4.0 Credit Generator]
end
subgraph Local_Cache ["πΎ Local Datasets (data/)"]
I[(catalog_enriched.json)]
J[(catalog_enriched.csv)]
end
subgraph Core_Service ["β‘ Service Layer (service.py)"]
K[O 1 In-Memory Indices<br>ISRC, Filename, Title]
L[Search & Multi-Filter Engine]
M[Standard License Pricing Engine]
end
subgraph Access_Layers ["π Client Access Interfaces"]
N[FastAPI REST Server<br>app.py :8000]
O[Python Client SDK<br>client.py]
P[Terminal CLI Tool<br>cli.py]
end
A & B & C --> E
E --> F & G & H
F & G & H --> I & J
I --> K
K --> L & M
L & M --> N & O & P
D -. Stream/Download .-> N & O & P
A comprehensive technical and legal analysis is documented in
ANALISIS_WEBSITE.md.
All musical compositions and master sound recordings on Incompetech are composed and owned by Kevin MacLeod. The music is copyrighted and is NOT Public Domain (with the exception of FreePD tracks).
What "Royalty-Free" means: You do NOT have to pay recurring royalties per view, per stream, or per sale of your product.
- Cost: $0 (100% Free).
- Commercial Use: Fully permitted (monetized YouTube videos, paid Steam/App Store/Play Store games, sponsored podcasts, commercial streams, indie films).
- Modifications & Derivatives: You may cut, splice, loop, compress, speed up, sing over, or add instruments. If you only cut/loop, no special mention is needed. If you add vocals or new instruments, you must state in the credits which parts are yours and which parts are Kevin's.
- Mandatory Condition: You MUST provide clear attribution/credit.
A. Single Track:
"Title of Track" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
http://creativecommons.org/licenses/by/4.0/
B. Multiple Tracks:
"Track 1", "Track 2", "Track 3"
Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0
http://creativecommons.org/licenses/by/4.0/
C. HTML Web Embed:
<p>
“Title of Track” Kevin MacLeod (<a href="https://incompetech.com" target="_blank" rel="noopener">incompetech.com</a>)<br>
Licensed under Creative Commons: By Attribution 4.0 License<br>
<a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener">http://creativecommons.org/licenses/by/4.0/</a>
</p>| Platform / Media | Proper Credit Location |
|---|---|
| YouTube / Vimeo | In the video description box or inside the closing credits of the video. |
| Twitch / Streaming | In your profile/channel panels under a dedicated "Music" section, or via a chatbot !music command. |
| Video Games | On the "Credits" screen accessible via the Settings/Options menu or end-game credits roll. |
| Films / Television | In the credit roll (either opening or closing credits). |
| Podcasts / Audio | Voiced aloud (voice-over credit) at the end of the episode or written in the episode show notes. |
| Live Stage / Theater | In the printed event program or via a voice announcement. |
Required if your format cannot or does not want to include credits (e.g., 30-second TV/radio commercials, corporate on-hold phone music, internal presentations under strict NDA):
- 1 Track: $30 flat
- 2 Tracks: $50 ($25/track)
- 3 to 18 Tracks: $20 per track (e.g., 5 tracks = $100, 10 tracks = $200).
- Terms: Non-exclusive, worldwide, in perpetuity for the named production title.
- Official Payment: Direct via PayPal to
payments@incompetech.com.
Every track has an allocated ISRC (International Standard Recording Code, e.g., USUAN1100772).
- If an automated bot or third-party rights aggregator submits a false Content ID claim on your YouTube video, file a Dispute referencing the track title, official ISRC, and the CC BY 4.0 legal text (
https://creativecommons.org/licenses/by/4.0/legalcode.en). - For Spotify podcast flags: Kevin MacLeod's official representative is "Kelvin Ruijters t/as Frequency", escalation email:
support@frequencydigital.com.
git clone https://github.com/ryanaryapramudya/Incompetech-api.git
cd Incompetech-apipython3 -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
pip install -r requirements.txtpython scraper.pyFetches the remote catalog, joins all metadata, and saves enriched datasets to data/.
python cli.py serve --port 8000Open your browser to explore the interactive Swagger documentation:
π http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
API status, catalog summary statistics, and license overview. |
GET |
/api/tracks |
Search & filter tracks (query, genre, feel, BPM range, duration range, pagination). |
GET |
/api/tracks/{id} |
Retrieve track metadata by ISRC code, filename, or title. |
GET |
/api/tracks/{id}/credits |
Get official attribution snippet in json, text, markdown, or html format. |
GET |
/api/tracks/{id}/download |
HTTP 302 redirect directly to the official MP3 stream/download URL. |
POST |
/api/credits/bulk |
Generate combined CC BY 4.0 credits for multiple tracks. |
POST |
/api/license/standard-calculator |
Calculate paid Standard License pricing & preview legal contract terms. |
GET |
/api/genres |
List all 24 musical genres with track counts. |
GET |
/api/feels |
List all mood/feel tags with track frequencies. |
GET |
/api/collections |
List all album collections and categories. |
GET |
/api/stats |
Aggregate catalog statistics (BPM average, duration ranges, etc.). |
POST |
/api/sync |
Force re-sync the catalog from incompetech.com. |
curl -s "http://localhost:8000/api/tracks?feel=Action&min_bpm=120&page_size=3" | jqcurl -s "http://localhost:8000/api/tracks/USUAN1100772/credits?format=text"Response:
"Sneaky Snitch" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
http://creativecommons.org/licenses/by/4.0/
curl -L -O "http://localhost:8000/api/tracks/USUAN1100772/download"curl -X POST "http://localhost:8000/api/credits/bulk" \
-H "Content-Type: application/json" \
-d '{
"titles": ["Carefree", "Sneaky Snitch"],
"derivative_notes": "Trimmed and looped for video game intro"
}' | jqYou can import IncompetechClient directly into Python scripts (video editors, voiceover bots, podcast pipelines) without even running an HTTP server:
from client import IncompetechClient
# Initialize client (Local Direct Mode - zero overhead, instant response)
client = IncompetechClient()
# 1. Search tracks by mood and tempo
results = client.search(feel="Suspenseful", min_bpm=90, page_size=5)
for track in results["items"]:
print(f"[{track['isrc']}] {track['title']} ({track['length']}) - {track['bpm']} BPM")
print(f"Direct MP3: {track['direct_download_url']}")
# 2. Lookup track by ISRC code
track = client.get_track("USUAN1100772")
print("Title:", track["title"])
print("Instruments:", track["instruments"])
# 3. Retrieve formatted attribution snippet
credit_text = client.get_credits("USUAN1100772", format="plain_text")
print(credit_text)
# 4. Download high-quality MP3 file locally
mp3_file = client.download_track("USUAN1100772", dest_folder="./downloads")
print(f"Saved audio to: {mp3_file}")
# 5. Generate bulk credits for multiple tracks
bulk = client.generate_bulk_credits(
titles=["Sneaky Snitch", "Carefree"],
derivative_notes="Custom vocal added by Creator"
)
print(bulk["plain_text"])Remote HTTP Mode: If your FastAPI server is deployed remotely, simply pass the
base_url:client = IncompetechClient(base_url="https://api-incompetech.yourdomain.com")
Use cli.py to search, inspect tracks, copy credits, or download music straight from your terminal:
# 1. Search catalog by keyword
python cli.py search "dungeon" --limit 5
# 2. Filter by genre, mood, and BPM
python cli.py search --genre "Electronica" --feel "Dark" --min-bpm 120
# 3. Display full track card and description
python cli.py info "Sneaky Snitch"
# 4. Generate attribution credits for one or more tracks
python cli.py credit "Carefree" "Monkeys Spinning Monkeys"
# 5. Output credit in Markdown format
python cli.py credit "Sneaky Snitch" --format markdown
# 6. Download track MP3 to a local directory
python cli.py download "Sneaky Snitch" --dest ./my_audio
# 7. Calculate commercial Standard License costs (no attribution)
python cli.py license 4 --company "Indie Game Studios" --title "Pixel Dungeon"
# 8. View catalog metrics & stats
python cli.py statsThe project includes an automated test suite covering the ETL scraper, service layer, FastAPI routes, credit formats, and SDK:
PYTHONPATH=. pytest tests/test_api.py -vTest results:
tests/test_api.py::test_service_catalog_loaded PASSED [ 7%]
tests/test_api.py::test_service_lookup_by_isrc PASSED [ 14%]
tests/test_api.py::test_service_lookup_by_filename_and_title PASSED [ 21%]
tests/test_api.py::test_service_search_filtering PASSED [ 28%]
tests/test_api.py::test_bulk_credits_generation PASSED [ 35%]
tests/test_api.py::test_standard_license_calculator PASSED [ 42%]
tests/test_api.py::test_api_root PASSED [ 50%]
tests/test_api.py::test_api_tracks_search PASSED [ 57%]
tests/test_api.py::test_api_track_detail PASSED [ 64%]
tests/test_api.py::test_api_track_credits_formats PASSED [ 71%]
tests/test_api.py::test_api_download_redirect PASSED [ 78%]
tests/test_api.py::test_api_bulk_credits PASSED [ 85%]
tests/test_api.py::test_api_genres_and_stats PASSED [ 92%]
tests/test_api.py::test_python_client_local_mode PASSED [100%]
============================== 14 passed in 0.29s ==============================
Ryan Arya Pramudya
GitHub: @ryanaryapramudya β’ Email: pramudyaryan5@gmail.com
All musical compositions and master sound recordings are composed by:
Kevin MacLeod β incompetech.com
Special gratitude to Kevin MacLeod for his monumental contribution to millions of content creators, game developers, and filmmakers worldwide.
This software project is licensed under the MIT License.
Musical works cataloged and streamed by this project remain subject to Kevin MacLeod's Creative Commons Attribution 4.0 International (CC BY 4.0) license or separate commercial Standard Licenses.