Windows PowerShell
All sample code, scripts, configuration files, and accompanying documentation (collectively, "Sample Materials"), is provided solely to demonstrate connectivity to the ADS-B Exchange Streaming Platform. Your use of the Sample Materials is subject to your existing Terms of Use with JETNET. In the event of any conflict, the Terms of Use shall control.
The Sample Materials are for evaluation and testing purposes only and are not intended or approved for use in any production or operational environment. Do not deploy these samples or any derivative code in a live environment without independent design, validation, and testing by qualified personnel. JETNET expressly disclaims responsibility for any damages, data loss, or service interruptions arising from production use of the Sample Materials.
The Sample Materials are provided "as is" without warranty of any kind, express or implied, including warranties of merchantability, fitness for a particular purpose, accuracy, or non-infringement. JETNET does not warrant that the Sample Materials are error-free or suitable for your environment.
The Sample Materials reference third-party software, including Docker, grpcurl, and jq, for convenience only. JETNET is not affiliated with, does not endorse, and assumes no responsibility for any third-party software. Use of third-party tools is at your own risk and subject to their respective licenses and terms.
Your Client ID and Subscription ID are confidential. Do not share them with unauthorized parties, embed them in source code repositories, or transmit them unsecured. JETNET is not liable for any unauthorized access or data exposure resulting from your failure to safeguard your credentials.
JETNET reserves the right to modify or withdraw the Sample Materials at any time without prior notice.
Your Credentials
Treat these as secrets — do not share or commit them to version control.
Streams can drop unexpectedly — network blips, planned platform updates, or transient errors. Build your client to auto-reconnect with exponential backoff (e.g. 1s, 2s, 4s, 8s etc) and resume the stream automatically.
| Value | |
|---|---|
| Endpoint | stream.adsbexchange.com:443 |
| ClientId | YOUR_CLIENT_ID |
| SubscriptionId | YOUR_SUBSCRIPTION_ID |
Prerequisites
Install grpcurl before starting. Place grpcurl.exe somewhere on your PATH and verify by running grpcurl --version in PowerShell.
Setup
Step 1: Save the file
Save the file below (jetnet-stream.ps1) to a folder of your choice.
param(
[Parameter(Mandatory)][string]$ClientId,
[Parameter(Mandatory)][string]$SubscriptionId,
[string]$Endpoint = "stream.adsbexchange.com:443"
)
$proto = @"
syntax = "proto3";
package jetnet.aircraft;
message StartStreamRequest {
string subscription_id = 1;
}
message JsonAircraftBatch {
bytes json_data = 1;
}
service AircraftStreamingService {
rpc StartStream(StartStreamRequest) returns (stream JsonAircraftBatch);
}
"@
# Write proto to a temp file
$protoDir = Join-Path $env:TEMP "jetnet-proto"
New-Item -ItemType Directory -Force -Path $protoDir | Out-Null
$protoFile = Join-Path $protoDir "aircraft.proto"
$proto | Set-Content -Path $protoFile -Encoding UTF8
Write-Host "Connecting to $Endpoint..." -ForegroundColor Cyan
Write-Host "Client: $ClientId" -ForegroundColor Gray
Write-Host "Subscription: $SubscriptionId" -ForegroundColor Gray
Write-Host ""
$body = "{`"subscription_id`": `"$SubscriptionId`"}"
$batch = 0
$buffer = [System.Collections.Generic.List[string]]::new()
& grpcurl `
-import-path $protoDir `
-proto aircraft.proto `
-H "client-id: $ClientId" `
-d $body `
$Endpoint `
jetnet.aircraft.AircraftStreamingService/StartStream |
ForEach-Object {
$buffer.Add($_)
try {
$msg = $buffer -join "`n" | ConvertFrom-Json -ErrorAction Stop
$buffer.Clear()
$jsonData = if ($msg.jsonData) { $msg.jsonData } else { $msg.json_data }
if (-not $jsonData) { return }
$bytes = [System.Convert]::FromBase64String($jsonData)
$text = [System.Text.Encoding]::UTF8.GetString($bytes)
$aircraft = $text | ConvertFrom-Json
$batch++
Write-Host ""
Write-Host "--- Batch $batch ($($aircraft.Count) aircraft) ---" -ForegroundColor Green
$aircraft | Select-Object -First 5 | ForEach-Object {
$hex = if ($_.hex) { $_.hex } else { "?" }
$flight = if ($_.flight) { $_.flight.Trim() } else { "?" }
$alt = if ($_.alt_baro){ $_.alt_baro } else { "?" }
$lat = if ($_.lat) { $_.lat } else { "?" }
$lon = if ($_.lon) { $_.lon } else { "?" }
$gs = if ($_.gs) { $_.gs } else { "?" }
Write-Host (" {0,-8} {1,-10} alt={2}ft lat={3} lon={4} gs={5}kt" -f $hex, $flight, $alt, $lat, $lon, $gs)
}
if ($aircraft.Count -gt 5) {
Write-Host " ... and $($aircraft.Count - 5) more"
}
} catch {
# Buffer incomplete JSON — keep accumulating
}
}
Step 2: Run
Open PowerShell in that folder and run:
Run in PowerShell — not Command Prompt.
.\jetnet-stream.ps1 `
-ClientId "YOUR_CLIENT_ID" `
-SubscriptionId "YOUR_SUBSCRIPTION_ID"
What to expect
Connecting to stream.adsbexchange.com:443...
Client: YOUR_CLIENT_ID
Subscription: YOUR_SUBSCRIPTION_ID
--- Batch 1 (42 aircraft) ---
a12345 UAL123 alt=35000ft lat=51.5074 lon=-0.1278 gs=480kt
b67890 BAW456 alt=28000ft lat=48.8566 lon=2.3522 gs=420kt
... and 40 more
Press Ctrl+C to stop.
No output or a connection error means a connectivity issue — check your firewall, credentials, or endpoint.