AlexaPy
Python API to control Amazon Echo Devices Programmatically.
What it is and what it does
alexapy is a Python library for controlling Amazon Echo and Alexa devices programmatically without an official Amazon API. It was originally built to power the alexa_media_player custom component for Home Assistant, allowing developers to automate Echo devices, query their state, and integrate them into broader home automation workflows.
The library handles authentication, device discovery, and command execution through reverse-engineered Alexa endpoints. It uses aiohttp for async HTTP communication, cryptography for secure operations, and beautifulsoup4 for parsing responses. Because it relies on undocumented endpoints rather than an official API, functionality may break when Amazon changes their service—this is a known and documented limitation.
Use it for:
- Automate Echo device control in Home Assistant or other home automation platforms
- Build scripts to query Alexa device state and trigger actions programmatically
- Integrate Alexa devices into custom Python applications that need device discovery and control
- Create voice-triggered workflows that respond to Alexa commands via this library
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
alexapy provides programmatic control of Amazon Echo and Alexa devices through Python, enabling automation and integration with home automation systems.
Yes, if you need programmatic Alexa control and accept the risk that undocumented API endpoints may break. Active maintenance, low install friction, and permissive licensing make it suitable for Home Assistant integrations and home automation projects. Not recommended for production systems requiring guaranteed stability.
Install
alexapy on PyPI
pip
pip install alexapyuv
uv add alexapypoetry
poetry add alexapyInstalling AlexaPy
Before you install
Low install friction with a pure-wheel distribution. Active maintenance as of 23 days ago. Depends on 12 runtime packages including aiohttp, requests, and cryptography for async and secure communication.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install alexapy
import asyncio
from alexapy import AlexaAPI
async def main():
alexa = AlexaAPI()
# Requires Amazon credentials and device setup
await alexa.login()
asyncio.run(main())
Requires valid Amazon account credentials and an active Alexa device; no official API means authentication method may change without notice.
Verify before relying
- Stability and reliability given that Alexa has no official API and the library may break without warning
- Current feature completeness and which Alexa device types are fully supported
- Whether authcaptureproxy dependency is a custom or third-party package and its maintenance status
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 12 — aiofiles, aiohttp, authcaptureproxy, backoff, beautifulsoup4, certifi, cryptography, httpx, pyotp, requests, simplejson, yarl |
| Maintenance | actively maintained — 23 days since the last release |
| First released | |
| Downloads | 672,721/month — #5,400 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: alexapy-1.30.0-py3-none-any.whl
Keywords: amazon, alexa, homeassistant
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
aioamazondevicesAsync Python library for controlling and…
permissive · top 15,000 on PyPI
plugwiseProvides Python interface to networked Plugwise…
permissive · top 15,000 on PyPI
aiomusiccastProvides async Python bindings to control…
unclear · top 15,000 on PyPI
teslajsonpyAn async Python library for interacting with…
permissive · top 15,000 on PyPI
zigpy-xbeeEnables zigpy to communicate with XBee-based…
copyleft · top 15,000 on PyPI
zigpy-znpAdds support for Texas Instruments ZNP Zigbee…
copyleft · top 15,000 on PyPI
aiohomekitAn asyncio-based HomeKit client library for…
permissive · top 15,000 on PyPI
switchbot-apiAn async Python library for controlling…
permissive · top 15,000 on PyPI
aioslimprotoAsync Python implementation of the SLIMProto…
permissive · top 15,000 on PyPI
pyhiveapiA Python library for controlling Hive smart…
permissive · top 15,000 on PyPI