Appearance
Download Flight Data API
📢 - INFO
This page describes the ACROWRX REST API for downloading flight data as CSV. The downloaded file uses the same format as the Download button in the Analysis window left menu.
Overview
The flight CSV export API lets you download processed flight data from flights you own (or contest flights you administer) while signed in to ACROWRX. Each response is a .csv file containing:
- A JSON metadata block with judge position, airplane adjustments, sequence information, scores, and figure markers.
- A blank line separator.
- A CSV data table with one row per flight sample.
This format is identical to what you get when you click Download in the Analysis left menu while viewing a flight from the database.
Authentication
Every request must include a valid Clerk session — the same login you use in the ACROWRX web app.
When you call the API from the browser while signed in, your session cookie is sent automatically. This is the intended way to use the endpoint (for example, from a page or bookmarklet in an authenticated ACROWRX session).
Endpoint
http
GET /api/flights/csv?fileName={userId}/{uuid}Base URL
Use your ACROWRX deployment host, for example:
https://acrowrx.com/api/flights/csv?fileName=...Query parameters
| Parameter | Required | Description |
|---|---|---|
fileName | Yes | Storage path of the flight, in the form {userId}/{uuid}. This is the same value shown in the Analysis URL file parameter when you open a flight. |
cropStart | No | Zero-based start sample index. Defaults to 0 (beginning of flight). |
cropEnd | No | Exclusive end sample index. Defaults to the full flight length. |
Authorization rules
- Personal flights — You must be the owner of the flight (
user_idmatches your account). - Contest flights — You must be the flight owner, or the contest administrator.
If the flight does not exist or you lack permission, the API returns 404.
Example requests
Browser (signed in)
Open this URL while logged into ACROWRX (replace the path with your flight):
https://acrowrx.com/api/flights/csv?fileName=USER_ID/FLIGHT_UUIDThe browser sends your Clerk session cookie and downloads the CSV file.
cURL with session cookie
Export a cookie from your browser after signing in (name varies by environment; often __session or similar Clerk cookie), then:
bash
curl -L \
-H "Cookie: __session=YOUR_SESSION_COOKIE" \
"https://acrowrx.com/api/flights/csv?fileName=USER_ID/FLIGHT_UUID" \
-o flight.csv⚠️ - SECURITY
Session cookies grant full access to your account. Do not share them or commit them to source control. They expire when you sign out or when the session ends.
cURL with crop range
Download samples 1000 through 5000 (exclusive end index):
bash
curl -L \
-H "Cookie: __session=YOUR_SESSION_COOKIE" \
"https://acrowrx.com/api/flights/csv?fileName=USER_ID/FLIGHT_UUID&cropStart=1000&cropEnd=5000" \
-o flight-cropped.csvJavaScript (same origin, signed in)
From code running on the same ACROWRX origin (for example, a page in the app), fetch includes cookies automatically:
javascript
const response = await fetch("/api/flights/csv?fileName=USER_ID/FLIGHT_UUID", {
credentials: "include",
});
if (!response.ok) {
throw new Error(`Export failed: ${response.status}`);
}
const csv = await response.text();Cross-origin calls from other websites cannot use your session unless CORS and credentials are explicitly configured for that origin (not supported for this endpoint by default).
Response
Success (200)
| Header | Value |
|---|---|
Content-Type | text/csv; charset=utf-8 |
Content-Disposition | attachment; filename="{safe-file-name}.csv" |
Cache-Control | private, no-store |
The response body is the CSV file content.
Error responses
| Status | Meaning |
|---|---|
401 | Not signed in (missing or invalid Clerk session). |
400 | Invalid query parameters or crop range. |
404 | Flight not found or not accessible to your account. |
502 | Flight file could not be retrieved from storage. |
503 | Storage is not configured on the server. |
500 | Unexpected server error. |
Error bodies are JSON, for example:
json
{ "error": "Unauthorized" }CSV file format
The file has three sections.
1. Metadata (JSON)
The first lines are a pretty-printed JSON object containing flight context:
| Field | Description |
|---|---|
meta.flightFileName | Storage path of the source flight |
meta.sequenceFolderName | Sequence folder name, if assigned |
OLAN | OpenAero sequence text |
figuresCount | Number of figures in the sequence |
totalK | Total K factor for the sequence |
scores | Figure scores from the database |
latitude, longitude, altitude | Judge position |
distance, heading | Judge distance to box edge and true heading |
category | Aerobatic category |
airplaneModel | Selected airplane model |
pitchAdjustment, rollAdjustment, headingAdjustment | Alignment corrections (°) |
verticalAdjustment, horizontalAdjustment, scaleAdjustment | Position and scale corrections |
sampleRate | Data sample rate (Hz) |
figureMarkers | Figure start markers, when complete |
📌 - TIP
When downloading from the Analysis window, judge position and airplane adjustments reflect your current Analysis settings. The API export uses values stored with the flight in the database.
2. Blank line
A single empty line separates metadata from tabular data.
3. Data columns
The header row and data rows use these columns:
YAW, PITCH, ROLL, GX, GY, GZ, LAT, LONG, ALT, VX, VY, VZ, AX, AY, AZ, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, MS, GNSS1SAT, GNSS1FIX, YAW_U, PITCH_U, ROLL_U, INS_STATUS, POS_U, VEL_U, GNSS2SAT, GNSS2FIX, ADC0–ADC7
Each subsequent row is one time sample from the (optionally cropped) flight.
Download button vs API
| Feature | Analysis Download button | API |
|---|---|---|
| Output format | CSV (+ .dat for admins) | CSV only |
| Crop range | Uses current crop handles in Analysis | cropStart / cropEnd query params |
| Judge & adjustments | Current Analysis session values | Values from stored flight metadata |
| Authentication | Clerk session (browser) | Clerk session (browser cookie) |
📌 - TIP
Use the Download button when you want a local copy that includes your current judge setup and crop from an active Analysis session. Use the API when you want the same CSV format from a direct URL while signed in, or from same-origin code inside the app.
Related pages
- Left & Right Menus — Download — in-app download button
- Personal Page — OnFlight Keys — OnFlight hardware activation keys (not used for this API)
- Video Export — export an MP4 video of your analysis views