# OpenSky Aircraft State Vectors Scraper (`automation-lab/opensky-aircraft-state-vectors`) Actor

Export current OpenSky aircraft identity, position, altitude, speed, heading and source timestamps by geographic bounding box.

- **URL**: https://apify.com/automation-lab/opensky-aircraft-state-vectors.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.22 / 1,000 aircraft-state extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## OpenSky Aircraft State Vectors Scraper

Collect a current snapshot of **OpenSky aircraft state vectors** inside a geographic bounding box.
The Actor exports one clean dataset row per aircraft with its ICAO24 identity, callsign, position, altitude, speed, heading, vertical rate, squawk, ground status, and source timestamps.

Use a ready-made New York, Los Angeles, or London region, or supply your own bounded coordinates.
No OpenSky account or API key is required for this current-state workflow.

### What does this OpenSky scraper do?

The Actor calls OpenSky Network's public current-state endpoint and converts its positional arrays into named fields.
It performs these steps:

1. validates the chosen region and limits;
2. requests one current snapshot for the bounding box;
3. validates the HTTP response and JSON shape;
4. normalizes available aircraft fields;
5. applies ground-status and callsign filters;
6. deduplicates aircraft by ICAO24;
7. saves at most `maxItems` rows.

This Actor intentionally covers current state vectors only.
It does not claim credentialed historical flights, airport arrivals, airport departures, aircraft ownership, or scheduled-route enrichment.

### Who is it for?

- Aviation researchers building regional traffic samples.
- Airport and operations analysts comparing repeated snapshots.
- Developers who need current aircraft telemetry without decoding OpenSky arrays.
- Data teams loading aircraft position records into warehouses or dashboards.
- Automation builders scheduling a lightweight regional traffic monitor.

### Why use this Actor?

OpenSky returns useful data in compact positional arrays.
This Actor provides a stable, documented object shape instead.

Key advantages include:

- geographic presets that work immediately;
- support for a validated custom bounding box;
- explicit SI units in field names;
- timestamps converted to ISO 8601;
- optional airborne, on-ground, and callsign-prefix filters;
- bounded retries with fresh route identities for transient source failures;
- pay-per-event billing tied to saved records;
- JSON, CSV, Excel, API, webhook, and MCP compatibility through Apify.

### Getting started

1. Open the Actor in Apify Console.
2. Keep **New York City** selected for the first run.
3. Set **Maximum aircraft** to `25`.
4. Leave the optional filters unset.
5. Click **Start**.
6. Open the **Dataset** tab when the run finishes.
7. Export the records or connect the dataset to your workflow.

A first run normally needs only this input:

```json
{
  "region": "new-york",
  "maxItems": 25
}
```

### Input parameters

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `region` | string | `new-york` | `new-york`, `los-angeles`, `london`, or `custom`. |
| `bounds` | object | New York example | Coordinates used only with `region: "custom"`. |
| `onGround` | boolean | unset | `true` keeps ground aircraft; `false` keeps airborne aircraft. |
| `callsignPrefix` | string | unset | Case-insensitive 1–8 letter/digit callsign prefix. |
| `maxItems` | integer | `100` | Maximum saved records, from 1 through 500. |

Custom bounds contain:

- `minLatitude`: southern edge from -90 through 90;
- `minLongitude`: western edge from -180 through 180;
- `maxLatitude`: northern edge from -90 through 90;
- `maxLongitude`: eastern edge from -180 through 180.

Minimum coordinates must be lower than maximum coordinates.
A custom box may cover at most 25 square degrees to avoid an unexpectedly large anonymous API request.

### Regional snapshot examples

Collect up to 50 airborne aircraft around London:

```json
{
  "region": "london",
  "onGround": false,
  "maxItems": 50
}
```

Collect on-ground aircraft around Los Angeles:

```json
{
  "region": "los-angeles",
  "onGround": true,
  "maxItems": 50
}
```

Use a custom box around Amsterdam:

```json
{
  "region": "custom",
  "bounds": {
    "minLatitude": 52.1,
    "minLongitude": 4.4,
    "maxLatitude": 52.6,
    "maxLongitude": 5.1
  },
  "maxItems": 100
}
```

### Output fields

| Field | Meaning |
| --- | --- |
| `icao24` | Lowercase hexadecimal ICAO transponder address. |
| `callsign` | Trimmed transmitted callsign, or `null`. |
| `originCountry` | Country OpenSky infers from the ICAO address. |
| `longitude`, `latitude` | Current WGS-84 coordinates, or `null`. |
| `barometricAltitudeMeters` | Barometric altitude in meters, or `null`. |
| `geometricAltitudeMeters` | Geometric altitude in meters, or `null`. |
| `onGround` | Whether OpenSky reports the aircraft on the ground. |
| `velocityMetersPerSecond` | Ground speed in meters per second, or `null`. |
| `headingDegrees` | Track clockwise from geographic north, or `null`. |
| `verticalRateMetersPerSecond` | Climb/descent rate, or `null`. |
| `squawk` | Transponder squawk code, or `null`. |
| `positionSource` | OpenSky numeric position-source code, or `null`. |
| `lastContactAt` | ISO timestamp of the latest aircraft message. |
| `positionUpdatedAt` | ISO timestamp of the latest position update. |
| `sourceSnapshotAt` | ISO timestamp assigned by OpenSky to the snapshot. |
| `collectedAt` | ISO timestamp when the Actor collected the response. |
| `sourceUrl` | Exact bounded OpenSky endpoint used by the run. |

Unavailable telemetry remains `null`; it is not replaced with zero or an invented value.

### Example output

A current row has this shape:

```json
{
  "icao24": "a1b2c3",
  "callsign": "EXA123",
  "originCountry": "United States",
  "longitude": -73.9123,
  "latitude": 40.7421,
  "barometricAltitudeMeters": 3048,
  "geometricAltitudeMeters": 3124.2,
  "onGround": false,
  "velocityMetersPerSecond": 215.7,
  "headingDegrees": 87.4,
  "verticalRateMetersPerSecond": 4.2,
  "squawk": "1200",
  "positionSource": 0,
  "lastContactAt": "2026-09-09T06:45:12.000Z",
  "positionUpdatedAt": "2026-09-09T06:45:11.000Z",
  "sourceSnapshotAt": "2026-09-09T06:45:15.000Z",
  "collectedAt": "2026-09-09T06:45:16.000Z",
  "sourceUrl": "https://opensky-network.org/api/states/all?lamin=40.45&lomin=-74.3&lamax=41&lomax=-73.6"
}
```

### How much does it cost to extract OpenSky aircraft state vectors?

Billing contains a **$0.0005 run-start event** plus one `aircraft-state` event for each saved row.
The BRONZE price is **$0.003696 per aircraft state vector**; volume tiers reduce the item price.
Failed records, filtered-out aircraft, and duplicate ICAO24 values do not incur an item event.

Approximate BRONZE examples:

| Saved aircraft | Approximate total |
| ---: | ---: |
| 1 | $0.0042 |
| 10 | $0.0375 |
| 25 | $0.0929 |
| 100 | $0.3701 |

Apify applies the pricing tier associated with your account.
The Console estimate shown before a run is the best place to confirm the applicable tier.

### Scheduling a traffic monitor

Create an Apify Schedule to run the same region every few minutes or hours.
Each run is an independent current snapshot.
Use `sourceSnapshotAt` and `icao24` as the core keys when comparing snapshots.

A common workflow is:

1. schedule the Actor;
2. export each default dataset through a webhook;
3. upsert rows into a warehouse by snapshot and ICAO24;
4. calculate additions, removals, movement, or aggregate traffic outside the Actor;
5. alert only on conditions relevant to your operation.

The Actor does not maintain cross-run history or send alerts itself.

### Integrations

Connect the default dataset to:

- Google Sheets for a small operational log;
- Make or Zapier for no-code routing;
- Slack or email through a webhook workflow;
- PostgreSQL, BigQuery, or Snowflake for snapshot comparison;
- Python notebooks for aviation research;
- BI tools for regional traffic dashboards.

For repeated ingestion, consume the dataset API after the run completes rather than scraping Console tables.

### Run with the Apify API using cURL

Replace `YOUR_TOKEN` with an Apify API token:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~opensky-aircraft-state-vectors/runs?token=YOUR_TOKEN&waitForFinish=120" \
  -H "Content-Type: application/json" \
  -d '{"region":"new-york","maxItems":25}'
```

Read dataset items with the `defaultDatasetId` returned by the run.

### Run with JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/opensky-aircraft-state-vectors').call({
  region: 'london',
  onGround: false,
  maxItems: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Run with Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/opensky-aircraft-state-vectors').call(
    run_input={'region': 'los-angeles', 'onGround': True, 'maxItems': 50}
)
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use with MCP and AI agents

Add the Apify MCP server to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/opensky-aircraft-state-vectors"
```

#### Claude Desktop, Cursor, and VS Code setup

Claude Desktop, Cursor, and VS Code can use this equivalent MCP configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/opensky-aircraft-state-vectors"
    }
  }
}
```

Example prompts:

- "Collect up to 25 current aircraft state vectors around New York."
- "Return current airborne aircraft around London as structured JSON."
- "Run the Los Angeles ground-aircraft snapshot and summarize counts by origin country."

Ask the agent to preserve the dataset URL when you need the complete machine-readable result.

### Reliability and retries

The Actor makes one official API request per attempt.
Apify cloud runs use the platform's low-cost proxy route because direct cloud egress to OpenSky can time out; local runs use direct HTTP.
It retries network errors, timeouts, HTTP 429, and temporary server errors up to three total attempts with backoff and a fresh proxy identity in the cloud.
Stable client errors and malformed responses fail instead of returning a misleading empty dataset.

No residential or browser fallback is enabled.
The structured API route avoids browser assets and keeps transfer small.

### Limits and data freshness

- Results are a current source snapshot, not guaranteed real-time tracking.
- Aircraft outside OpenSky receiver coverage may be absent.
- Callsign, coordinates, altitude, squawk, and movement fields may be null.
- Ground-state reporting depends on aircraft and receiver data.
- `maxItems` limits saved matches, not the upstream snapshot response.
- Callsign filtering applies only when a callsign is transmitted.
- The anonymous OpenSky service can enforce rate limits or change availability.
- This Actor does not expose credentialed history.

For broad coverage, schedule several bounded regional runs rather than submitting one huge custom box.

### Empty results

An empty dataset can be valid when no aircraft currently match the box and filters.
If the result is unexpectedly empty:

1. remove `callsignPrefix`;
2. unset `onGround`;
3. choose a busy preset;
4. run at a different time;
5. check the run log for an upstream error.

Empty successful runs still incur the one-time start event but no aircraft-state events.

### Troubleshooting

**The custom box is rejected**

Check coordinate order, coordinate ranges, and the 25-square-degree area limit.
Minimum values must be lower than maximum values.

**I expected more aircraft**

Increase `maxItems`, remove optional filters, and remember that receiver coverage changes over time.

**A run fails with HTTP 429**

The Actor already performs bounded retries.
Reduce schedule frequency and retry later rather than starting many parallel runs.

**Some values are null**

OpenSky does not receive every telemetry field from every aircraft.
Null preserves that uncertainty accurately.

### Responsible use and legality

OpenSky data is provided by a community receiver network and remains subject to OpenSky's terms and policies.
Use the Actor for lawful research, analysis, and operations.
Do not use aircraft data to facilitate harassment, targeting, surveillance abuse, or unsafe activity.

You are responsible for your schedule frequency, data retention, downstream use, and compliance with applicable law.
Avoid collecting more data than your legitimate purpose requires.

### FAQ

**Does this require an OpenSky account?**

No. The supported current bounded state-vector request uses the anonymous public endpoint.

**Does it return flight history?**

No. Credentialed historical flights, arrivals, and departures are deliberately excluded.

**Can I query one aircraft?**

You can narrow a region and optionally filter by callsign prefix.
The Actor does not promise a direct ICAO24 lookup mode.

**Can I use a custom airport radius?**

Provide a custom rectangle around the airport.
Radius-to-box conversion is not part of the input contract.

**Are the records deduplicated?**

Yes. Each run keeps at most one record per ICAO24 value.

**Can I export CSV or Excel?**

Yes. Use the standard Apify dataset export controls or API formats.

**Will it compare runs for me?**

No. Store or forward scheduled datasets, then compare by ICAO24 and snapshot timestamp in your downstream system.

### Related Automation Lab Actors

For complementary public aviation operations data, use [FAA NAS Status & Airport Delays Scraper](https://apify.com/automation-lab/faa-nas-status-airport-delays-scraper).
It covers FAA airport delay and closure advisories rather than individual aircraft telemetry.

Use the two datasets together only when their different source scopes fit your analysis.

# Actor input Schema

## `region` (type: `string`):

Preset geographic area, or Custom to use the coordinates below.

## `bounds` (type: `object`):

Coordinates used only when Region is Custom. The box may cover at most 25 square degrees.

## `onGround` (type: `boolean`):

Leave unset for every aircraft, true for aircraft on the ground, or false for airborne aircraft.

## `callsignPrefix` (type: `string`):

Optional 1–8 letter/digit prefix, for example DAL or BAW. Filtering is case-insensitive.

## `maxItems` (type: `integer`):

Maximum number of matching state-vector records saved to the dataset.

## Actor input object example

```json
{
  "region": "new-york",
  "bounds": {
    "minLatitude": 40.45,
    "minLongitude": -74.3,
    "maxLatitude": 41,
    "maxLongitude": -73.6
  },
  "maxItems": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

Default dataset containing the current aircraft records collected by this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "region": "new-york",
    "bounds": {
        "minLatitude": 40.45,
        "minLongitude": -74.3,
        "maxLatitude": 41,
        "maxLongitude": -73.6
    },
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/opensky-aircraft-state-vectors").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "region": "new-york",
    "bounds": {
        "minLatitude": 40.45,
        "minLongitude": -74.3,
        "maxLatitude": 41,
        "maxLongitude": -73.6,
    },
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/opensky-aircraft-state-vectors").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "region": "new-york",
  "bounds": {
    "minLatitude": 40.45,
    "minLongitude": -74.3,
    "maxLatitude": 41,
    "maxLongitude": -73.6
  },
  "maxItems": 20
}' |
apify call automation-lab/opensky-aircraft-state-vectors --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/opensky-aircraft-state-vectors"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rZe0L1GC9NsGhhuLH/builds/5VUZRLX2EzDdb8mNQ/openapi.json
