All Projects → maddox → Itunes Api

maddox / Itunes Api

Licence: mit
🎵 A simple server providing a RESTful service for controlling iTunes

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Itunes Api

My Home Automation
Stars: ✭ 151 (-9.04%)
Mutual labels:  home-assistant, home-automation
Feature Requests
ESPHome Feature Request Tracker
Stars: ✭ 160 (-3.61%)
Mutual labels:  home-assistant, home-automation
Ha Floorplan
Floorplan for Home Assistant
Stars: ✭ 1,626 (+879.52%)
Mutual labels:  home-assistant, home-automation
Homebridge Dacp
Remotely control Apple TV and iTunes via HomeKit.
Stars: ✭ 128 (-22.89%)
Mutual labels:  home-automation, itunes
Smart Home
Phodal's Smart Home Setup Guide:HomeBridge + Home Assistant + Amazon Echo
Stars: ✭ 149 (-10.24%)
Mutual labels:  home-assistant, home-automation
Garhage
a Home-Automation-friendly ESP8266-based MQTT Garage Door Controller
Stars: ✭ 163 (-1.81%)
Mutual labels:  home-assistant, home-automation
Simple Weather Card
Minimalistic weather card for Home Assistant
Stars: ✭ 135 (-18.67%)
Mutual labels:  home-assistant, home-automation
Addon Ssh
SSH & Web Terminal - Home Assistant Community Add-ons
Stars: ✭ 114 (-31.33%)
Mutual labels:  home-assistant, home-automation
Ha Tts Bluetooth Speaker
TTS Bluetooth Speaker for Home Assistant
Stars: ✭ 140 (-15.66%)
Mutual labels:  home-assistant, home-automation
Nexus433
433MHz temperature and humidity sensor receiver that integrates with home automation systems.
Stars: ✭ 137 (-17.47%)
Mutual labels:  home-assistant, home-automation
Android Mqtt Alarm Panel
Android Alarm Panel for Home Assistant and Home Automation Platforms (http://thanksmister.com/android-mqtt-alarm-panel/)
Stars: ✭ 124 (-25.3%)
Mutual labels:  home-assistant, home-automation
Home assistant files
Here are my Home Assistant configuration files
Stars: ✭ 159 (-4.22%)
Mutual labels:  home-assistant, home-automation
Hassbian Scripts
Scripts used in the Hassbian image.
Stars: ✭ 121 (-27.11%)
Mutual labels:  home-assistant, home-automation
Entity Controller
Entity and lighting controller for managing devices via timers, scripts, and sun-based time restrictions.
Stars: ✭ 156 (-6.02%)
Mutual labels:  home-assistant, home-automation
Itead sonoff
Alternative firmware for Itead Sonoff switches, based on the MQTT protocol and a TLS connection
Stars: ✭ 115 (-30.72%)
Mutual labels:  home-assistant, home-automation
Mysmarthome
⭐️ ALIVE Again! ⭐️ SmartHome - Nothing but smarthome stuff here! Have fun browsing through my home automation setup... ping me on Discord with any questions! 👍
Stars: ✭ 133 (-19.88%)
Mutual labels:  home-assistant, home-automation
Home Assistant Config
🏠 My Home Assistant configuration and documentation. More info below.
Stars: ✭ 107 (-35.54%)
Mutual labels:  home-assistant, home-automation
Hass Data Detective
Explore and analyse your Home Assistant data
Stars: ✭ 109 (-34.34%)
Mutual labels:  home-assistant, home-automation
Python Miio
Python library & console tool for controlling Xiaomi smart appliances
Stars: ✭ 1,995 (+1101.81%)
Mutual labels:  home-assistant, home-automation
Home Assistant Mail And Packages
Home Assistant integration providing day of package counts and USPS informed delivery images.
Stars: ✭ 155 (-6.63%)
Mutual labels:  home-assistant, home-automation

iTunes API!!

iTunes API is a simple REST server allowing you to query/control a local running iTunes instance. Once you have a way to make RESTful API calls to control iTunes, you can integrate its control into any of your own software.

This is especially convenient for integrating into any sort of Home Automation you might have.

Last confirmed working version of iTunes: 12.2.1.

Features

  • play/stop/pause/playpause/next/previous control over what's playing.
  • query to return what's currently playing.
  • fetch the art of the currently playing song.
  • set a specific playlist to play, by name.
  • query to return a list of available AirPlay endpoints.
  • set an AirPlay endpoint to be active. (This can be multiple, since iTunes supports it).

Setup

script/bootstrap

Running It

Get up and running immediatly with script/server.

iTunes API will run on port 8181 by default. Use the PORT environment variable to use your own port.

Forever

iTunes API has support for Forever. It uses launchd on OS X to kick it off so that it starts on boot. There is no init.d other Linux support of this type. Pull requests would be welcome for this though.

Development

You can simply run it by calling script/server. This will run it in development mode with logging to standard out.

Install as Service on OS X

script/install

Logging

iTunes API logs all of its requests. In production, it logs to a file at log/logs.log. In development mode, it just logs to stdout.

Development

Launch the app via script/server to run it in the development environment.

Docs

This is a quick overview of the service. Read app.js if you need more info.

Resources

Here's a list of resources that may be returned in a response.

NowPlaying Resource

The NowPlaying resource returns all the information about if iTunes is playing and what is playing.

{
  "player_state": "playing",
  "volume": 60,
  "muted": false,
  "id": "AC4FFD2271422B47",
  "name": "Forever",
  "artist": "HAIM",
  "album": "Days Are Gone (2013)",
  "playlist": "Summer Jams",
  "shuffle": "songs",
  "repeat": "all"
}

Playlist Resource

The Playlist resource returns all the information about a playlist in your library.

{
  "id": "outkast-the-90s",
  "name": "Outkast: The '90s",
  "loved": true,
  "duration_in_seconds": 4544,
  "time": "1:15:44"
},

AirPlayDevice Resource

The AirPlayDevice resource returns all the information about an available AirPlay device on your network.

{
  "id": "63-22-fa-1f-f5-d4",
  "name": "Living Room",
  "kind": "Apple TV",
  "active": true,
  "selected": true,
  "volume": 60,
  "supports_video": true,
  "supports_audio": true,
  "network_address": "63:22:fa:1f:f5:d4"
}

Methods

These are the endpoints you can hit to do things.

Info

Use these endpoints to query the current state of iTunes.

GET /now_playing => NowPlayingResource
GET /artwork => JPEG Data (image/jpeg)

Player Control

Use these endpoints to control what's currently playing.

PUT /playpause => NowPlayingResource
PUT /stop => NowPlayingResource
PUT /previous => NowPlayingResource
PUT /next => NowPlayingResource
PUT /play => NowPlayingResource
PUT /pause => NowPlayingResource
PUT /volume [level=20] => NowPlayingResource
PUT /volume [muted=true] => NowPlayingResource
PUT /shuffle [mode=songs] => NowPlayingResource
PUT /shuffle [mode=off] => NowPlayingResource
PUT /repeat [mode=all] => NowPlayingResource
PUT /repeat [mode=off] => NowPlayingResource

Playlists

Use this endpoint to start a specific playlist.

GET /playlists => {"playlists": [PlaylistResource, PlaylistResource, ...]}
PUT /playlists/:id/play => NowPlayingResource

AirPlay Control

Use these endpoints to query and set AirPlay devices. You can set multiple AirPlay devices to be used at the same time.

GET /airplay_devices => {"airplay_devices": [AirPlayDevice, AirPlayDevice, ...]}
GET /airplay_devices/:id => AirPlayDevice
PUT /airplay_devices/:id/on => AirPlayDevice
PUT /airplay_devices/:id/off => AirPlayDevice
PUT /volume [level=20] => AirPlayDevice

Contributions

  • fork
  • create a feature branch
  • open a Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].