Giter Site home page Giter Site logo

itunes-artwork's Introduction

iTunes Artwork API

A barebones API for searching the iTunes Artwork library for music album covers (or any other type of medium you want), built using Node.JS and Restify.

Inspired by Ben Dodson's iTunes Artwork Finder, I decided to roll out my own open source API wrapper for the iTunes Search API.

Usage

  • Clone this reposity using the command -
git clone [email protected]:paambaati/itunes-artwork.git
  • Install required modules using -
npm install
  • Send a GET request to the server (assuming it is running on the default 127.0.0.1 on port 3000) of this form -
http://127.0.0.1:3000/find/search?term=<ALBUM NAME>&country=<COUNTRY CODE>

For example, to fetch all results for the Rise Against album "Long Forgotten Songs: B-Sides & Covers", the URL will be 127.0.0.1:3000/find/search?term=long forgotten songs&country=us

The JSON response looks like this.

[{
    "album": "Long Forgotten Songs: B-Sides & Covers 2000-2013",
    "artist": "Rise Against",
    "artwork_100": "http://a5.mzstatic.com/us/r30/Music6/v4/b9/f6/1a/b9f61a0b-d8f6-5314-c089-cf6b81f9fcd1/UMG_cvrart_00602537463053_01_RGB72_1470x1470_13UAAIM42739.100x100-75.jpg",
    "artwork_600": "http://a5.mzstatic.com/us/r30/Music6/v4/b9/f6/1a/b9f61a0b-d8f6-5314-c089-cf6b81f9fcd1/UMG_cvrart_00602537463053_01_RGB72_1470x1470_13UAAIM42739.600x600-75.jpg",
    "artwork_1200": "http://a5.mzstatic.com/us/r30/Music6/v4/b9/f6/1a/b9f61a0b-d8f6-5314-c089-cf6b81f9fcd1/UMG_cvrart_00602537463053_01_RGB72_1470x1470_13UAAIM42739.1200x1200-75.jpg"
}]

Notes

  1. Allowed country codes are one of these - "us", "gb", "ca", "de", "se", "nl", "it", "ch", "ru", "au", "jp", "br", "fr", "gr", "es", "dk".
  2. The API wrapper searches only for music album covers by default. For searching other media (like book covers, app store icons, etc.), refer the Search API documentation here.
  3. Restify automatically URL-encodes the search query string, so spaces are okay to be sent in the GET body.

itunes-artwork's People

Contributors

anaghsharma avatar paambaati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

itunes-artwork's Issues

getting error from http request

when I make a http get request I get the error:

{"code":"InternalError","message":"obj.hasOwnProperty

is not a function"}

first time i did it through chrome modifying the url with the server running, then I made an http get request
(Im new to node.js)

`var http = require('http');

var options = {
host: '127.0.0.1',
port: 3000,
path: '/find/search?term=long%20forgotten%20songs&country=us'
};

console.log("Start");
var x = http.request(options,function(res){
var data = [];
console.log("Connected");
res.on('data',function(chunk){
data.push(chunk);
}).on('end', function() {
//at this point data is an array of Buffers
//so Buffer.concat() can make us a new Buffer
//of all of them together
var buffer = JSON.parse(data);
console.log(JSON.stringify(buffer));
});
});

x.end();`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.