Skip to content

ko28/melon-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

63 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

melon-api

PyPI GitHub last commit Downloads License: MIT

A simple chart API written in Flask for Melon, a Korean music streaming service.

Endpoints

Chart

Fetch Melon charts.

URL : /api/v1/chart/:time

URL Parameters : time=[string] where time is the specific chart you want. Available charts:

  • live
  • rise(depercated)
  • day
  • week
  • month

Method : GET

Responses

Condition : User receives chart in json format. Response contains 100 entries. Key is ranking of song; value is name, ranking, artists, songId, albumId (id's are Melon specific).

Code : 200 OK

Eample Content :

{"1": {"name": "์—์ž‡(Prod.&Feat. SUGA of BTS)", "ranking": "1", "artists": "์•„์ด์œ ", "songId": "32578498", "albumId": "10426648"}, "2": {"name": "๋‚˜๋น„์™€ ๊ณ ์–‘์ด (feat.๋ฐฑํ˜„ (BAEKHYUN))", "ranking": "2", "artists": "๋ณผ๋นจ๊ฐ„์‚ฌ์ถ˜๊ธฐ", "songId": "32583036", "albumId": "10427559"}, "3": {"name": "ON", "ranking": "3", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399830", "albumId": "10377346"}, "4": {"name": "์•„๋กœํ•˜", "ranking": "4", "artists": "์กฐ์ •์„", "songId": "32491274", "albumId": "10409054"}, "5": {"name": "์‚ด์ง ์„ค๋ œ์–ด (Nonstop)", "ranking": "5", "artists": "์˜ค๋งˆ์ด๊ฑธ", "songId": "32559781", "albumId": "10423289"}, "6": {"name": "00:00 (Zero Oโ€™Clock)", "ranking": "6", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399832", "albumId": "10377346"}, "7": {"name": "Black Swan", "ranking": "7", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32323969", "albumId": "10377346"}, "8": {"name": "์ž‘์€ ๊ฒƒ๋“ค์„ ์œ„ํ•œ ์‹œ (Boy With Luv) (Feat. Halsey)", "ranking": "8", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "31737197", "albumId": "10273641"}, "9": {"name": "์นœ๊ตฌ", "ranking": "9", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399834", "albumId": "10377346"}, "10": {"name": "Filter", "ranking": "10", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399827", "albumId": "10377346"}, "11": {"name": "์‹œ์ฐจ", "ranking": "11", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399828", "albumId": "10377346"}, "12": {"name": "Moon", "ranking": "12", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399835", "albumId": "10377346"}, "13": {"name": "Inner Child", "ranking": "13", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399833", "albumId": "10377346"}, "14": {"name": "We are Bulletproof : the Eternal", "ranking": "14", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399837", "albumId": "10377346"}, "15": {"name": "Louder than bombs", "ranking": "15", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399829", "albumId": "10377346"}, "16": {"name": "์šฑ (UGH!)", "ranking": "16", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399831", "albumId": "10377346"}, "17": {"name": "Interlude : Shadow", "ranking": "17", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399826", "albumId": "10377346"}, "18": {"name": "Respect", "ranking": "18", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399836", "albumId": "10377346"}, "19": {"name": "Outro : Ego", "ranking": "19", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "32399838", "albumId": "10377346"}, "20": {"name": "Ridinโ€™", "ranking": "20", "artists": "NCT DREAM", "songId": "32550660", "albumId": "10421298"}, "21": {"name": "Yours (Feat. ์ดํ•˜์ด, ์ฐฝ๋ชจ)", "ranking": "21", "artists": "Raiden, ์ฐฌ์—ด (CHANYEOL)", "songId": "32590490", "albumId": "10429159"}, "22": {"name": "Zombie", "ranking": "22", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586848", "albumId": "10428497"}, "23": {"name": "๋„ˆ๋ฅผ ์‚ฌ๋ž‘ํ•˜๊ณ  ์žˆ์–ด", "ranking": "23", "artists": "๋ฐฑํ˜„ (BAEKHYUN)", "songId": "32298623", "albumId": "10372655"}, "24": {"name": "์ฒ˜์Œ์ฒ˜๋Ÿผ", "ranking": "24", "artists": "์— ์”จ๋”๋งฅ์Šค (M.C the MAX)", "songId": "32486613", "albumId": "10408131"}, "25": {"name": "๋‚ด๊ฒŒ ๋งํ•ด์ค˜ (7 Days)", "ranking": "25", "artists": "NCT DREAM", "songId": "32550662", "albumId": "10421298"}, "26": {"name": "์‹œ์ž‘", "ranking": "26", "artists": "๊ฐ€ํ˜ธ (Gaho)", "songId": "32345931", "albumId": "10381712"}, "27": {"name": "๋„ˆ์˜ ์ž๋ฆฌ (Puzzle Piece)", "ranking": "27", "artists": "NCT DREAM", "songId": "32550664", "albumId": "10421298"}, "28": {"name": "์‚ฌ๋ž‘, ํ•˜์ž", "ranking": "28", "artists": "์ˆ˜ํ˜ธ (SUHO)", "songId": "32495729", "albumId": "10409970"}, "29": {"name": "์‚ฌ๋ž‘์€ ๋˜๋‹ค์‹œ (Love Again)", "ranking": "29", "artists": "NCT DREAM", "songId": "32550663", "albumId": "10421298"}, "30": {"name": "๋ค๋”๋Ÿผ(Dumhdurum)", "ranking": "30", "artists": "Apink (์—์ดํ•‘ํฌ)", "songId": "32528369", "albumId": "10416723"}, "31": {"name": "Quiet Down", "ranking": "31", "artists": "NCT DREAM", "songId": "32550661", "albumId": "10421298"}, "32": {"name": "Happy", "ranking": "32", "artists": "ํƒœ์—ฐ (TAEYEON)", "songId": "32572926", "albumId": "10425647"}, "33": {"name": "Dolphin", "ranking": "33", "artists": "์˜ค๋งˆ์ด๊ฑธ", "songId": "32559782", "albumId": "10423289"}, "34": {"name": "์ข‹์€ ์‚ฌ๋žŒ ์žˆ์œผ๋ฉด ์†Œ๊ฐœ์‹œ์ผœ์ค˜", "ranking": "34", "artists": "์กฐ์ด (JOY)", "songId": "32473998", "albumId": "10405712"}, "35": {"name": "์ด์ œ ๋‚˜๋งŒ ๋ฏฟ์–ด์š”", "ranking": "35", "artists": "์ž„์˜์›…", "songId": "32508053", "albumId": "10412319"}, "36": {"name": "๋„ˆ์—๊ฒŒ ๊ฐ€๋Š” ์ด ๊ธธ ์œ„์—์„œ (๋„ˆ.์ด.๊ธธ)", "ranking": "36", "artists": "๋ฐฑํ˜„ (BAEKHYUN)", "songId": "32421335", "albumId": "10396078"}, "37": {"name": "Obsession", "ranking": "37", "artists": "EXO", "songId": "32217921", "albumId": "10357878"}, "38": {"name": "Blueming", "ranking": "38", "artists": "์•„์ด์œ ", "songId": "32183386", "albumId": "10346650"}, "39": {"name": "METEOR", "ranking": "39", "artists": "์ฐฝ๋ชจ (CHANGMO)", "songId": "32224272", "albumId": "10359162"}, "40": {"name": "ํ”๋“ค๋ฆฌ๋Š” ๊ฝƒ๋“ค ์†์—์„œ ๋„ค ์ƒดํ‘ธํ–ฅ์ด ๋Š๊ปด์ง„๊ฑฐ์•ผ", "ranking": "40", "artists": "์žฅ๋ฒ”์ค€", "songId": "32003395", "albumId": "10320500"}, "41": {"name": "Love me or Leave me", "ranking": "41", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586850", "albumId": "10428497"}, "42": {"name": "์˜์›… (่‹ฑ้›„; Kick It)", "ranking": "42", "artists": "NCT 127", "songId": "32393669", "albumId": "10391380"}, "43": {"name": "Go away go away", "ranking": "43", "artists": "์ฐฌ์—ด (CHANYEOL), ํŽ€์น˜ (Punch)", "songId": "32325829", "albumId": "10377809"}, "44": {"name": "์•„๋ฌด๋…ธ๋ž˜", "ranking": "44", "artists": "์ง€์ฝ” (ZICO)", "songId": "32313543", "albumId": "10375118"}, "45": {"name": "Dance Monkey", "ranking": "45", "artists": "Tones And I", "songId": "31979846", "albumId": "10316394"}, "46": {"name": "๋งˆ์Œ์„ ๋“œ๋ ค์š”", "ranking": "46", "artists": "์•„์ด์œ ", "songId": "32378104", "albumId": "10388744"}, "47": {"name": "๊ทธ๋•Œ ๊ทธ ์•„์ธ", "ranking": "47", "artists": "๊น€ํ•„", "songId": "32377231", "albumId": "10388581"}, "48": {"name": "Made In You", "ranking": "48", "artists": "์ˆ˜ํ˜ธ (SUHO)", "songId": "32495730", "albumId": "10409970"}, "49": {"name": "์–ด๋Š 60๋Œ€ ๋…ธ๋ถ€๋ถ€์ด์•ผ๊ธฐ", "ranking": "49", "artists": "์ž„์˜์›…", "songId": "32397381", "albumId": "10391899"}, "50": {"name": "์šฐ๋ฆฌ ๋งŒ๋‚จ์ด", "ranking": "50", "artists": "ํดํ‚ด", "songId": "32550314", "albumId": "10421264"}, "51": {"name": "ํ•ด์™€ ๋‹ฌ์ฒ˜๋Ÿผ", "ranking": "51", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586847", "albumId": "10428497"}, "52": {"name": "๋Œ๋ฉ์ด", "ranking": "52", "artists": "ํ•˜ํ˜„์šฐ (๊ตญ์นด์Šคํ…)", "songId": "32361098", "albumId": "10385262"}, "53": {"name": "์žํ™”์ƒ", "ranking": "53", "artists": "์ˆ˜ํ˜ธ (SUHO)", "songId": "32495732", "albumId": "10409970"}, "54": {"name": "Iโ€™m in Trouble", "ranking": "54", "artists": "๋‰ด์ด์ŠคํŠธ", "songId": "32588064", "albumId": "10428727"}, "55": {"name": "Oโ‚‚", "ranking": "55", "artists": "์ˆ˜ํ˜ธ (SUHO)", "songId": "32495728", "albumId": "10409970"}, "56": {"name": "๋„ˆ์˜ ์ฐจ๋ก€ (Feat. ์œคํ•˜)", "ranking": "56", "artists": "์ˆ˜ํ˜ธ (SUHO)", "songId": "32495733", "albumId": "10409970"}, "57": {"name": "ํ™”๋ คํ•˜์ง€ ์•Š์€ ๊ณ ๋ฐฑ", "ranking": "57", "artists": "๊ทœํ˜„ (KYUHYUN)", "songId": "32508146", "albumId": "10412335"}, "58": {"name": "์•”๋ง‰ ์ปคํŠผ", "ranking": "58", "artists": "์ˆ˜ํ˜ธ (SUHO)", "songId": "32495731", "albumId": "10409970"}, "59": {"name": "๋ฐ”๋žจ", "ranking": "59", "artists": "์ž„์˜์›…", "songId": "32323330", "albumId": "10377157"}, "60": {"name": "์–ด๋–ป๊ฒŒ ์ง€๋‚ด (Prod. By VAN.C)", "ranking": "60", "artists": "์˜ค๋ฐ˜", "songId": "32438894", "albumId": "10399190"}, "61": {"name": "WANNABE", "ranking": "61", "artists": "ITZY (์žˆ์ง€)", "songId": "32445339", "albumId": "10400522"}, "62": {"name": "Tick Tock", "ranking": "62", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586849", "albumId": "10428497"}, "63": {"name": "๋ฐ˜๋งŒ", "ranking": "63", "artists": "์ง„๋ฏผํ˜ธ", "songId": "32224409", "albumId": "10359204"}, "64": {"name": "Memories", "ranking": "64", "artists": "Maroon 5", "songId": "32055419", "albumId": "10330593"}, "65": {"name": "Psycho", "ranking": "65", "artists": "Red Velvet (๋ ˆ๋“œ๋ฒจ๋ฒณ)", "songId": "32273582", "albumId": "10368053"}, "66": {"name": "ํ’ˆ", "ranking": "66", "artists": "๋ณผ๋นจ๊ฐ„์‚ฌ์ถ˜๊ธฐ", "songId": "32594046", "albumId": "10427559"}, "67": {"name": "๋Šฆ์€ ๋ฐค ๋„ˆ์˜ ์ง‘ ์•ž ๊ณจ๋ชฉ๊ธธ์—์„œ", "ranking": "67", "artists": "๋…ธ์„", "songId": "32156286", "albumId": "10348811"}, "68": {"name": "Afraid", "ranking": "68", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586853", "albumId": "10428497"}, "69": {"name": "๋‚˜์˜ ํ•˜๋ฃจ๋Š” ๋‹ค ๋„ˆ๋กœ ๊ฐ€๋“ํ•ด", "ranking": "69", "artists": "์ง€์ฝ” (ZICO), ์›ฌ๋”” (WENDY)", "songId": "32600237", "albumId": "10431009"}, "70": {"name": "๋ณด๋ผ๋น› ์—ฝ์„œ", "ranking": "70", "artists": "์ž„์˜์›…", "songId": "32441451", "albumId": "10399605"}, "71": {"name": "Don't Start Now", "ranking": "71", "artists": "Dua Lipa", "songId": "32137576", "albumId": "10345880"}, "72": {"name": "FIESTA", "ranking": "72", "artists": "IZ*ONE (์•„์ด์ฆˆ์›)", "songId": "32381408", "albumId": "10389281"}, "73": {"name": "1 to 10", "ranking": "73", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586852", "albumId": "10428497"}, "74": {"name": "๋‚ด ๋ˆˆ๋ฌผ ๋ชจ์•„", "ranking": "74", "artists": "ํœ˜์ธ (Whee In)", "songId": "32561690", "albumId": "10423707"}, "75": {"name": "๋ด„๋‚ ", "ranking": "75", "artists": "๋ฐฉํƒ„์†Œ๋…„๋‹จ", "songId": "30244931", "albumId": "10037969"}, "76": {"name": "๊ทธ๋Œ€ ๊ณ ์šด ๋‚ด์‚ฌ๋ž‘", "ranking": "76", "artists": "์–ด๋ฐ˜์ž์นดํŒŒ", "songId": "32521396", "albumId": "10415229"}, "77": {"name": "์˜ค๋Š˜๋„ ๋น›๋‚˜๋Š” ๋„ˆ์—๊ฒŒ (To You My Light) (Feat.์ด๋ผ์˜จ)", "ranking": "77", "artists": "๋งˆํฌํˆฝ (MAKTUB)", "songId": "31853557", "albumId": "10294603"}, "78": {"name": "2002", "ranking": "78", "artists": "Anne-Marie", "songId": "31029291", "albumId": "10137250"}, "79": {"name": "๋•Œ๋ ค์ณ", "ranking": "79", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586851", "albumId": "10428497"}, "80": {"name": "๋‚˜๋ณด๋‹ค ๋” ์‚ฌ๋ž‘ํ•ด์š”", "ranking": "80", "artists": "๊น€ํ˜ธ์ค‘", "songId": "32560653", "albumId": "10423519"}, "81": {"name": "์šฐ๋ฆฌ ์™œ ํ—ค์–ด์ ธ์•ผ ํ•ด", "ranking": "81", "artists": "์‹ ์˜ˆ์˜", "songId": "32187544", "albumId": "10353881"}, "82": {"name": "Love poem", "ranking": "82", "artists": "์•„์ด์œ ", "songId": "32143487", "albumId": "10346650"}, "83": {"name": "Stay Tonight", "ranking": "83", "artists": "์ฒญํ•˜", "songId": "32559498", "albumId": "10423202"}, "84": {"name": "๋„ˆ๋ฅผ ๊ทธ๋ฆฐ ์šฐ์ฃผ (Insomnia2020) (Feat. ์ด๋ผ์˜จ)", "ranking": "84", "artists": "๋งˆํฌํˆฝ (MAKTUB)", "songId": "32556676", "albumId": "10422586"}, "85": {"name": "Moon Dance", "ranking": "85", "artists": "๋‰ด์ด์ŠคํŠธ", "songId": "32588063", "albumId": "10428727"}, "86": {"name": "Stuck with U", "ranking": "86", "artists": "Ariana Grande, Justin Bieber", "songId": "32584913", "albumId": "10428037"}, "87": {"name": "๋„Œ ๋‚ด๊ฐ€ ๋ณด๊ณ  ์‹ถ์ง€ ์•Š๋‚˜ ๋ด", "ranking": "87", "artists": "์‹ ์˜ˆ์˜", "songId": "32559566", "albumId": "10423244"}, "88": {"name": "Back To Me (ํ‰ํ–‰์šฐ์ฃผ)", "ranking": "88", "artists": "๋‰ด์ด์ŠคํŠธ", "songId": "32588066", "albumId": "10428727"}, "89": {"name": "๋ชจ๋“  ๋‚ , ๋ชจ๋“  ์ˆœ๊ฐ„ (Every day, Every Moment)", "ranking": "89", "artists": "ํดํ‚ด", "songId": "30962526", "albumId": "10149492"}, "90": {"name": "๊ผญ", "ranking": "90", "artists": "๋‰ด์ด์ŠคํŠธ", "songId": "32588067", "albumId": "10428727"}, "91": {"name": "์ผํŽธ๋‹จ์‹ฌ ๋ฏผ๋“ค๋ ˆ์•ผ", "ranking": "91", "artists": "์ž„์˜์›…", "songId": "32362652", "albumId": "10385603"}, "92": {"name": "Firework", "ranking": "92", "artists": "๋‰ด์ด์ŠคํŠธ", "songId": "32588065", "albumId": "10428727"}, "93": {"name": "์–ด๋–ป๊ฒŒ ์ด๋ณ„๊นŒ์ง€ ์‚ฌ๋ž‘ํ•˜๊ฒ ์–ด, ๋„ ์‚ฌ๋ž‘ํ•˜๋Š” ๊ฑฐ์ง€", "ranking": "93", "artists": "AKMU (์•…๋™๋ฎค์ง€์…˜)", "songId": "32061975", "albumId": "10331947"}, "94": {"name": "Maniac", "ranking": "94", "artists": "Conan Gray", "songId": "32122539", "albumId": "10343276"}, "95": {"name": "๋ฐ˜๋”ง๋ณ„", "ranking": "95", "artists": "๋‰ด์ด์ŠคํŠธ", "songId": "32588068", "albumId": "10428727"}, "96": {"name": "์ƒ์‚ฌํ™”", "ranking": "96", "artists": "์ž„์˜์›…", "songId": "32555799", "albumId": "10422374"}, "97": {"name": "๋ฐฐ์‹ ์ž", "ranking": "97", "artists": "์ž„์˜์›…", "songId": "32457760", "albumId": "10402513"}, "98": {"name": "Zombie (English Ver.)", "ranking": "98", "artists": "DAY6 (๋ฐ์ด์‹์Šค)", "songId": "32586854", "albumId": "10428497"}, "99": {"name": "LALALILALA", "ranking": "99", "artists": "์—์ดํ”„๋ฆด (APRIL)", "songId": "32550258", "albumId": "10421256"}, "100": {"name": "๋‘ ์ฃผ๋จน", "ranking": "100", "artists": "์ž„์˜์›…", "songId": "32457753", "albumId": "10402513"}}

Example call

cURL : curl 'https://<endpoint>/api/v1/chart/live'

fetch :

fetch('https://<endpoint>/api/v1/chart/live')
  .then(res => res.json())
  .then(console.log)

Lyrics

Fetch lyrics from Melon.

URL : /api/v1/lyric/:songId

URL Parameters : songId=[int] where songId is the Melon specific id of a song.

Method : GET

Condition : User receives lyric in json format. Key is lyric and value is the lyric of the song.

Code : 200 OK

Eample Content :

{
"lyric": "์ด ๋ฐค ๊ทธ๋‚ ์˜ ๋ฐ˜๋”ง๋ถˆ์„\n๋‹น์‹ ์˜ ์ฐฝ ๊ฐ€๊นŒ์ด ๋ณด๋‚ผ๊ฒŒ์š”\n์Œ ์‚ฌ๋ž‘ํ•œ๋‹ค๋Š” ๋ง์ด์—์š”\n๋‚˜ ์šฐ๋ฆฌ์˜ ์ฒซ ์ž…๋งž์ถค์„ ๋– ์˜ฌ๋ ค\n๊ทธ๋Ÿผ ์–ธ์ œ๋“  ๋ˆˆ์„ ๊ฐ๊ณ \n์Œ ๊ฐ€์žฅ ๋จผ ๊ณณ์œผ๋กœ ๊ฐ€์š”\n๋‚œ ํŒŒ๋„๊ฐ€ ๋จธ๋ฌผ๋˜\n๋ชจ๋ž˜ ์œ„์— ์ ํžŒ ๊ธ€์”จ์ฒ˜๋Ÿผ\n๊ทธ๋Œ€๊ฐ€ ๋ฉ€๋ฆฌ ์‚ฌ๋ผ์ ธ ๋ฒ„๋ฆด ๊ฒƒ ๊ฐ™์•„\n๋Š˜ ๊ทธ๋ฆฌ์›Œ ๊ทธ๋ฆฌ์›Œ\n์—ฌ๊ธฐ ๋‚ด ๋งˆ์Œ์†์—\n๋ชจ๋“  ๋ง์„ ๋‹ค ๊บผ๋‚ด์–ด ์ค„ ์ˆœ ์—†์ง€๋งŒ\n์‚ฌ๋ž‘ํ•œ๋‹ค๋Š” ๋ง์ด์—์š”\n์–ด๋–ป๊ฒŒ ๋‚˜์—๊ฒŒ\n๊ทธ๋Œ€๋ž€ ํ–‰์šด์ด ์˜จ ๊ฑธ๊นŒ\n์ง€๊ธˆ ์šฐ๋ฆฌ ํ•จ๊ป˜ ์žˆ๋‹ค๋ฉด ์•„\n์–ผ๋งˆ๋‚˜ ์ข‹์„๊นŒ์š”\n๋‚œ ํŒŒ๋„๊ฐ€ ๋จธ๋ฌผ๋˜\n๋ชจ๋ž˜ ์œ„์— ์ ํžŒ ๊ธ€์”จ์ฒ˜๋Ÿผ\n๊ทธ๋Œ€๊ฐ€ ๋ฉ€๋ฆฌ ์‚ฌ๋ผ์ ธ ๋ฒ„๋ฆด ๊ฒƒ ๊ฐ™์•„\n๋˜ ๊ทธ๋ฆฌ์›Œ ๋” ๊ทธ๋ฆฌ์›Œ\n๋‚˜์˜ ์ผ๊ธฐ์žฅ ์•ˆ์—\n๋ชจ๋“  ๋ง์„ ๋‹ค ๊บผ๋‚ด์–ด ์ค„ ์ˆœ ์—†์ง€๋งŒ\n์‚ฌ๋ž‘ํ•œ๋‹ค๋Š” ๋ง\n์ด ๋ฐค ๊ทธ๋‚ ์˜ ๋ฐ˜๋”ง๋ถˆ์„ ๋‹น์‹ ์˜\n์ฐฝ ๊ฐ€๊นŒ์ด ๋„์šธ๊ฒŒ์š”\n์Œ ์ข‹์€ ๊ฟˆ ์ด๊ธธ ๋ฐ”๋ผ์š”"
}

Example call

cURL : curl 'https://<endpoint>/api/v1/lyric/30314784'

fetch :

fetch('https://<endpoint>/api/v1/lyric/30314784')
  .then(res => res.json())
  .then(console.log)

Use as a Python package

melon-api can be installed from pypi

pip install melonapi

Example usage

Run on Repl.it

Printing out the top 100 songs right now on Melon.

from melonapi import scrapeMelon
print(scrapeMelon.getList("LIVE").decode())

Local Development

Setup local virtualenv

Virtualenv is a handy way to manage different Python projects.

  1. Install virtualenv via pip3 install virtualenv
  2. Create a virtual environment via virtualenv venv
  3. Activate virtual environment via source venv/bin/activate
  4. Install dependencies via pip install -r requirements.txt

Serve API

Run the following command inside the melonapi directory to serve up flask web app.

FLASK_ENV=development flask run --port 5000

Navigate to localhost:5000 to access the app.

Spotify setup (optional)

Add this to your .bashrc or run it in your shell or add it your server env vars if you want the Spotify playlist feature.

https://developer.spotify.com/

export client_id='yourClientID'
export client_secret='yourClientSecret'

Run as Docker container

You can obtain the image via Dockerhub or build from source

Download from Dockerhub

docker pull danielko8/melonapi:latest

Build

docker build -t melon-api:latest .

Run

docker run -p 5000:5000 melon-api

Now go to localhost:5000 to access the api!

Todo

  • Search (by name, genre, etc)
  • Playlist creation, list of song id's and create a new playlist (reverse engineering)
  • List most popular songs of a given artist
  • Visualize data
  • Download lyric support
  • Top 100 songs => Spotify Playlist conversion (nontrival task as spotify search is not very good for korean input, apple music search is really good but their api rate limited me so i tried tor but seemed like abuse)
  • Caching results (https://hackernoon.com/a-cache-is-fast-enhancing-our-api-with-redis-bd61d13c3ca8 and http://ghibliapi.herokuapp.com/#section/Helper-Libraries)
  • Refractor scrapeMelon to remove subprocess, this will not work on windows machines which do not have cURL
  • Auto push to pip using github actions