Blink.NET
1.0.5
See the version list below for details.
dotnet add package Blink.NET --version 1.0.5
NuGet\Install-Package Blink.NET -Version 1.0.5
<PackageReference Include="Blink.NET" Version="1.0.5" />
<PackageVersion Include="Blink.NET" Version="1.0.5" />
<PackageReference Include="Blink.NET" />
paket add Blink.NET --version 1.0.5
#r "nuget: Blink.NET, 1.0.5"
#:package Blink.NET@1.0.5
#addin nuget:?package=Blink.NET&version=1.0.5
#tool nuget:?package=Blink.NET&version=1.0.5
Blink.NET
A .NET library (netstandard2.1) for accessing local Blink camera storage: fetching the list of clips, downloading and deleting videos. Works on runtimes that support .NET Standard 2.1 (for example .NET 6/7/8/9, .NET Core 3.0+).
Features
- Login/password authorization and PIN confirmation (2FA).
- Fetching dashboard data and the list of Sync Modules.
- Getting the list of clips from a module's local storage.
- Download a clip as a byte array.
- Delete a clip from the device.
- Configurable delay between requests to stabilize the API.
Installation
Via .NET CLI:
dotnet add package Blink.NET
Via PackageReference:
<ItemGroup>
<PackageReference Include="Blink.NET" Version="x.y.z" />
</ItemGroup>
Quick start
Simple scenario: login, complete 2FA, then download clips from a single Sync Module.
using Blink;
var client = new BlinkClient();
// 1) Login with email/password
bool okLogin = await client.TryLoginAsync("you@example.com", "YourPassword");
if (!okLogin)
{
throw new Exception("Wrong email or password");
}
// 2) Enter and verify 2FA code
Console.Write("Enter 2FA code: ");
var code = Console.ReadLine() ?? string.Empty;
bool ok2FA = await client.TryVerifyPinAsync(code);
if (!ok2FA)
{
throw new Exception("Invalid 2FA code");
}
// 3) Get clips from a single Sync Module (throws if more than one module exists)
var videos = await client.GetVideosFromSingleModuleAsync();
// 4) Download the first clip as bytes
var first = videos.First();
byte[] bytes = await client.GetVideoBytesAsync(first);
File.WriteAllBytes($"{first.Id}.mp4", bytes);
Quick start (with Serilog and refresh token)
Use a two-stage flow: first login with email/password and complete 2FA to obtain a refresh token; then reuse the refresh token on subsequent runs to skip 2FA.
using Serilog;
using Blink;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger();
var client = new BlinkClient();
// 1) First-time login + 2FA to get refresh token
bool okLogin = await client.TryLoginAsync(email, password);
if (!okLogin)
{
Log.Error("Wrong email or password");
return;
}
Log.Information("Enter 2FA code:");
while (true)
{
string code = Console.ReadLine() ?? string.Empty;
if (string.IsNullOrWhiteSpace(code))
{
Log.Warning("Code cannot be empty. Please enter the 2FA code:");
continue;
}
bool ok2FA = await client.TryVerifyPinAsync(code);
if (ok2FA)
{
Log.Information("2FA verification successful.");
break;
}
Log.Error("Invalid 2FA code. Please try again:");
}
Log.Information("Save this refresh token for future use: {RefreshToken}", client.RefreshToken);
// 2) Subsequent runs — login with refresh token
bool okRefresh = await client.TryLoginWithRefreshTokenAsync(refreshTokenFromStore);
if (!okRefresh)
{
Log.Error("Failed to refresh token");
return;
}
var dashboard = await client.GetDashboardAsync();
Log.Information("Dashboard retrieved. Modules count: {Count}", dashboard.SyncModules.Length);
Step-by-step usage
- Login and, if necessary, PIN confirmation:
bool okLogin = await client.TryLoginAsync(email, password);
if (!okLogin)
{
// invalid credentials
return;
}
bool ok2FA = await client.TryVerifyPinAsync(pinFromSms);
if (!ok2FA)
{
// invalid/expired code
return;
}
- Get Sync Modules and clips:
var dashboard = await client.GetDashboardAsync();
var module = dashboard.SyncModules.Single(); // choose the desired module
var videos = await client.GetVideosFromModuleAsync(module);
- Download a clip and (optionally) delete it:
var data = await client.GetVideoBytesAsync(video);
await File.WriteAllBytesAsync($"{video.Id}.mp4", data);
// if needed — delete the clip from the device
// await client.DeleteVideoAsync(video);
Client settings
- GeneralSleepTime (int, default 3500 ms) Small delay between requests. Without it the server may sometimes return an empty response. You can reduce or disable it if your environment is stable. For background jobs, consider higher values (e.g., 5–10 seconds) to improve reliability.
Token handling:
- RefreshToken (string?) — populated after successful 2FA. Store it securely and use
TryLoginWithRefreshTokenAsyncto skip 2FA on subsequent runs.
Brief API overview
- Task<Dashboard> GetDashboardAsync()
- Task<IEnumerable<BlinkVideoInfo>> GetVideosFromModuleAsync(SyncModule module)
- Task<IEnumerable<BlinkVideoInfo>> GetVideosFromSingleModuleAsync()
- Task<byte[]> GetVideoBytesAsync(BlinkVideoInfo video, int tryCount = 3)
- Task DeleteVideoAsync(BlinkVideoInfo video)
Login/token flows:
- Task<bool> TryLoginAsync(string email, string password)
- Task<bool> TryVerifyPinAsync(string code)
- Task<bool> TryLoginWithRefreshTokenAsync(string refreshToken)
- string? RefreshToken { get; }
Events:
- event Action<string>? OnTokenRefreshed — raised whenever a new refresh token is issued (after successful 2FA or token refresh). Subscribe to persist it:
var client = new BlinkClient();
client.OnTokenRefreshed += token => SaveRefreshToken(token);
See models and exceptions in Sources/Blink/Models and Sources/Blink/Exceptions.
Sample console application from the repository
There is a small example in Sources/Blink.ConsoleTest:
- Create a
secrets.jsonfile next toProgram.cswith your login/password:
{
"email": "you@example.com",
"password": "YourPassword"
}
- Build and run:
cd Sources/Blink.ConsoleTest
dotnet build
dotnet run
Requirements and limitations
- A Blink account and at least one Sync Module with local storage are required.
- Client verification (PIN via SMS) is often enabled. This is normal behavior.
- The Blink API can be unstable without pauses between requests — use
GeneralSleepTime.
Note on clip IDs (observed behavior):
- The IDs returned in the video list appear to be short‑lived session identifiers. In practice, fetching the binary clip by a previously listed ID may start failing with “file not found” after a short time window (approx. 10–20 minutes, based on observations; not officially documented).
- Recommendation: process videos in small batches. Fetch a list, immediately download a subset, then re‑list before continuing to avoid stale IDs.
Security
- Do not store login/password in the repository. Use user secrets, environment variables, or encrypted stores.
- Remove tokens and personal data from logs before publishing.
Building from source
dotnet build Sources/Blink/Blink.csproj
Disclaimer
This project is not affiliated with Blink, Amazon, or any other companies. Use at your own risk and in accordance with Blink's terms of service.
License
MIT — see LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Net.Http.Json (>= 9.0.8)
- System.Text.Json (>= 9.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.6 | 147 | 12/6/2025 |
| 1.0.5 | 204 | 10/19/2025 |
| 1.0.4 | 159 | 10/19/2025 |
| 1.0.3 | 170 | 10/19/2025 |
| 1.0.2 | 169 | 10/19/2025 |
| 1.0.1 | 173 | 10/19/2025 |
| 1.0.0 | 171 | 10/19/2025 |
| 0.1.18 | 184 | 10/1/2025 |
| 0.1.17 | 202 | 9/5/2025 |
| 0.1.16 | 308 | 4/10/2025 |
| 0.1.15 | 209 | 4/9/2025 |
| 0.1.14 | 207 | 11/10/2024 |
| 0.1.13 | 152 | 10/30/2024 |
| 0.1.12 | 163 | 10/30/2024 |
| 0.1.11 | 147 | 10/22/2024 |
| 0.1.10 | 173 | 9/27/2024 |
| 0.1.9 | 183 | 9/27/2024 |
| 0.1.8 | 182 | 9/25/2024 |
| 0.1.7 | 199 | 9/24/2024 |
| 0.1.6 | 181 | 9/24/2024 |
| 0.1.5 | 180 | 9/24/2024 |
| 0.1.4 | 179 | 9/24/2024 |
| 0.1.3 | 155 | 9/24/2024 |
| 0.1.2 | 204 | 9/24/2024 |
| 0.1.1 | 189 | 9/24/2024 |
| 0.1.0 | 190 | 9/16/2024 |