Skip to content
프로젝트

소개

Fetch album or artist cover art — "The Beatles" → http://path/to/beatles.jpg

웹 및 앱 개발

이 수치를 측정하는 방법

What you can do

  • Use anywhere, browser or Node (UMD bundle — browser support)
  • Works in React + Next.js, client and server, via cross-fetch
  • Promise and callback API
  • Fetch images for albums or artists

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
-2

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original
album-art

Fetch album or artist cover art ➔ "The Beatles" → http://path/to/beatles.jpg

npm version npm downloads CI License Try on RunKit

album-art demo

[!IMPORTANT] This library is feature-complete and only receives bug-fix updates. Feature requests still welcome — please open an issue.

[!NOTE] Last.fm cannabilized their own API and broke many applications, including this one. album-art now uses Spotify for image data. The public API is fully backwards-compatible.

Features

  • Use anywhere, browser or Node (UMD bundle — browser support)
  • Works in React + Next.js, client and server, via cross-fetch
  • Promise and callback API
  • Fetch images for albums or artists
  • Multiple size options (small · medium · large)
  • Powered by Spotify's catalog

Install

npm install album-art

In the browser:

<!-- albumArt as a window global -->
<script src="https://unpkg.com/album-art"></script>

Also available via JSDelivr.

Usage

const albumArt = require("album-art");

albumArt("Rush").then(console.log);
//=> http://path/to/rush.jpg

Callback form

albumArt("Rush", (error, response) => {
  console.log(response);
  //=> http://path/to/rush.jpg
});

With album and size options

albumArt("Rush", { album: "2112", size: "small" }).then(console.log);
//=> http://path/to/rush_2112_small.jpg

[!TIP] Try it live without installing — open in RunKit (here's an example output).

API

albumArt(artist [, options] [, callback])

Accepts an artist string to search for. Returns a Promise that resolves to a URL string.

Argument Type Required Description
artist string ✅ Artist to search for
options.album string Album to search for
options.size "small" | "medium" | "large" Requested image size
callback (err, response) => void Optional Node-style callback

CLI

Install globally to use from the shell:

npm install --global album-art

album-art --help
#  Usage
#    $ album-art artist [album] [size]
#
#  Example
#    $ album-art 'The Beatles' --album 'Abbey Road' --size 'large'
#    http://path/to/beatles/abbey_road_large.jpg

Related

Part of a small family of media-data utilities:

Acknowledgments

License

MIT © Lacy Morrow

If album-art saved you time, consider sponsoring on GitHub, supporting on Patreon, or buying a coffee.

관련 프로젝트 살펴보기

불러오는 중…