Skip to main content

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-client

Or with uv:

uv add melon-api-client

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.chart 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.com vs m2.melon.com); each requires its own full URL.
  • PREDICTEDDATA may 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

melon_api_client-0.1.0.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

melon_api_client-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file melon_api_client-0.1.0.tar.gz.

File metadata

  • Download URL: melon_api_client-0.1.0.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for melon_api_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1e018fa6da7be68851d34f6a69c184b07b61e9b6bf1559b16bc6d0195cb176f
MD5 22ae20136fcd67f7896ac3a41b330d0d
BLAKE2b-256 79dd8ee842e7845eb2768fc8ea4dca1fc16b39b1e7d1274e71e04de8629ea8c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for melon_api_client-0.1.0.tar.gz:

Publisher: publish.yml on bunniesnu/melon-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file melon_api_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for melon_api_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f271aa3aa8ef82da9571ffbe46c7ea8582735d7cd8d24c30aed8e43e5be9f616
MD5 f61e9c4ed29b9420d9cf0896c8162978
BLAKE2b-256 19235096b8706b9711d8d5ebaa38be7e0f208b24486bf4b1e9fece2276595af4

See more details on using hashes here.

Provenance

The following attestation bundles were made for melon_api_client-0.1.0-py3-none-any.whl:

Publisher: publish.yml on bunniesnu/melon-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page