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 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.2.0.tar.gz (49.2 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.2.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for melon_api_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f7f4c973ddf6c24772f3e9f13f3a59ae4c197afe8396fa712e4f91d828a6b3be
MD5 1a790ef0b53c5f57ed17e3c6b314f24e
BLAKE2b-256 21ecc8f7c6d9edee2311cefa78dac56feeeb3fbcd40e17c377e2d5d73b28e481

See more details on using hashes here.

Provenance

The following attestation bundles were made for melon_api_client-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for melon_api_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c96fe092ac848fdbec70cc617ef8414471b861d4fe12998c98101207b448801
MD5 1dd131b03d60a4e91082f592d9a40515
BLAKE2b-256 8d395a04e190591ce00cd249a1f67d0fb8bb4a37b020872a0f031d65a33784b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for melon_api_client-0.2.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