melon-api
An unofficial API SDK for Melon music app — a Python client for fetching, modeling, and persisting data from multiple Melon endpoints.
Features
- Realtime chart — hourly chart data from
m.app.melon.com - Chart report — detailed report for a given song
- Top100 chart — Melon’s Top100 chart (distinct from the realtime chart)
- Chart graph — historical chart position data
Requirements
- Python 3.10+
Installation
pip install melon-api-edao
Or with uv:
uv add melon-api-edao
Usage
Run the main script to fetch data from all endpoints and save results to data/:
uv run python main.py
Each response is saved as a timestamped JSON file (UTC) in the data/ directory to avoid overwriting previous runs.
As a library
from melon import MelonClient
with MelonClient() as client:
chart = client.get_top100_chart()
Development
Clone the repo and install with dev dependencies:
git clone https://github.com/bunniesnu/melon-api.git
cd melon-api
make install
Or manage the environment directly with uv:
uv sync --all-extras --dev # install with dev dependencies
uv sync # sync environment with lockfile
uv lock # update the lockfile
Run tests (excludes live API tests by default):
make test
Run live tests (hits real Melon endpoints):
make test-live
Other available targets:
make help # list all available targets
make clean # remove build artifacts and caches
Publishing
Build the package:
make build
Publish to PyPI:
make publish
Project structure
melon-api/
├── src/melon/ # package source
├── tests/ # test suite
├── data/ # output JSON files (gitignored)
├── main.py # example script hitting all endpoints
└── pyproject.toml
Notes
- The realtime chart and chart report endpoints live on different hosts (
m.app.melon.comvsm2.melon.com); each requires its own full URL. PREDICTEDDATAmay be absent from chart report responses.- Output uses
model_dump(mode="json", by_alias=True)to preserve Melon’s original field names.
Links
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file melon_api_edao-0.2.0.tar.gz.
File metadata
- Download URL: melon_api_edao-0.2.0.tar.gz
- Upload date:
- Size: 49.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1e9d99699de1c7b0083a6b8cfc85b7e841893c7c3ffbd67195dc5a9e94a7232
|
|
| MD5 |
7df14f802b3c594a32a9eba1e9ddc9cf
|
|
| BLAKE2b-256 |
c1974ab7352f251ef3560c66cb848c18d873c3eeee97d369da0b37af6497d566
|
File details
Details for the file melon_api_edao-0.2.0-py3-none-any.whl.
File metadata
- Download URL: melon_api_edao-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f7409e1bf04800bc93afed46617f27bbf76dba1f3edbe348f1545c211cea43f
|
|
| MD5 |
de7e0dd39e3e2383a5c025ded4aa612b
|
|
| BLAKE2b-256 |
0fc3e95df4cc4098317cfb9af3fa24c7293fa1ba65966f5bf990632b81e2ddfd
|