Skip to main content

A Blink camera Python library running on Python 3.

Project description

blinkpy Build Status Coverage Status Docs PyPi Version Codestyle

A Python library for the Blink Camera system (Python 3.7+)

Like the library? Consider buying me a cup of coffee!

Buy me a Coffee!

Disclaimer: Published under the MIT license - See LICENSE file for more details.

“Blink Wire-Free HS Home Monitoring & Alert Systems” is a trademark owned by Immedia Inc., see for more information. I am in no way affiliated with Blink, nor Immedia Inc.

Original protocol hacking by MattTW :

API calls faster than 60 seconds is not recommended as it can overwhelm Blink’s servers. Please use this module responsibly.


pip install blinkpy

Installing Development Version

To install the current development version, perform the following steps. Note that the following will create a blinkpy directory in your home area:

$ cd ~
$ git clone
$ cd blinkpy
$ rm -rf build dist
$ python3 bdist_wheel
$ pip3 install --upgrade dist/*.whl

If you’d like to contribute to this library, please read the contributing instructions.

For more information on how to use this library, please read the docs.


This library was built with the intention of allowing easy communication with Blink camera systems, specifically to support the Blink component in homeassistant.

Quick Start

The simplest way to use this package from a terminal is to call Blink.start() which will prompt for your Blink username and password and then log you in. In addition, http requests are throttled internally via use of the Blink.refresh_rate variable, which can be set at initialization and defaults to 30 seconds.

from blinkpy.blinkpy import Blink

blink = Blink()

This flow will prompt you for your username and password. Once entered, if you likely will need to send a 2FA key to the blink servers (this pin is sent to your email address). When you receive this pin, enter at the prompt and the Blink library will proceed with setup.

Supplying credentials from file

Other use cases may involved loading credentials from a file. This file must be json formatted and contain a minimum of username and password. A built in function in the blinkpy.helpers.util module can aid in loading this file. Note, if no_prompt is desired, a similar flow can be followed as above.

from blinkpy.blinkpy import Blink
from blinkpy.auth import Auth
from blinkpy.helpers.util import json_load

blink = Blink()
auth = Auth(json_load("<File Location>"))
blink.auth = auth

Saving credentials

This library also allows you to save your credentials to use in future sessions. Saved information includes authentication tokens as well as unique ids which should allow for a more streamlined experience and limits the frequency of login requests. This data can be saved as follows (it can then be loaded by following the instructions above for supplying credentials from a file):"<File location>")

Getting cameras

Cameras are instantiated as individual BlinkCamera classes within a BlinkSyncModule instance. All of your sync modules are stored within the Blink.sync dictionary and can be accessed using the name of the sync module as the key (this is the name of your sync module in the Blink App).

The below code will display cameras and their available attributes:

for name, camera in blink.cameras.items():
  print(name)                   # Name of the camera
  print(camera.attributes)      # Print available attributes of camera

The most recent images and videos can be accessed as a bytes-object via internal variables. These can be updated with calls to Blink.refresh() but will only make a request if motion has been detected or other changes have been found. This can be overridden with the force flag, but this should be used for debugging only since it overrides the internal request throttling.

camera = blink.cameras['SOME CAMERA NAME']
blink.refresh(force=True)  # force a cache update USE WITH CAUTION
camera.image_from_cache.raw  # bytes-like image object (jpg)
camera.video_from_cache.raw  # bytes-like video object (mp4)

The blinkpy api also allows for saving images and videos to a file and snapping a new picture from the camera remotely:

camera = blink.cameras['SOME CAMERA NAME']
camera.snap_picture()       # Take a new picture with the camera
blink.refresh()             # Get new information from server

Download videos

You can also use this library to download all videos from the server. In order to do this, you must specify a path. You may also specifiy a how far back in time to go to retrieve videos via the since= variable (a simple string such as "2017/09/21" is sufficient), as well as how many pages to traverse via the stop= variable. Note that by default, the library will search the first ten pages which is sufficient in most use cases. Additionally, you can specify one or more cameras via the camera= property. This can be a single string indicating the name of the camera, or a list of camera names. By default, it is set to the string 'all' to grab videos from all cameras. If you are downloading many items, setting the delay parameter is advised in order to throttle sequential calls to the API. By default this is set to 1 but can be any integer representing the number of seconds to delay between calls.

Example usage, which downloads all videos recorded since July 4th, 2018 at 9:34am to the /home/blink directory with a 2s delay between calls:

blink.download_videos('/home/blink', since='2018/07/04 09:34', delay=2)

Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

blinkpy-0.19.2-py3-none-any.whl (24.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page