Skip to content

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:

  1. A JSON metadata block with judge position, airplane adjustments, sequence information, scores, and figure markers.
  2. A blank line separator.
  3. 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

ParameterRequiredDescription
fileNameYesStorage 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.
cropStartNoZero-based start sample index. Defaults to 0 (beginning of flight).
cropEndNoExclusive end sample index. Defaults to the full flight length.

Authorization rules

  • Personal flights — You must be the owner of the flight (user_id matches 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_UUID

The browser sends your Clerk session cookie and downloads the CSV file.

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.csv

JavaScript (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)

HeaderValue
Content-Typetext/csv; charset=utf-8
Content-Dispositionattachment; filename="{safe-file-name}.csv"
Cache-Controlprivate, no-store

The response body is the CSV file content.

Error responses

StatusMeaning
401Not signed in (missing or invalid Clerk session).
400Invalid query parameters or crop range.
404Flight not found or not accessible to your account.
502Flight file could not be retrieved from storage.
503Storage is not configured on the server.
500Unexpected 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:

FieldDescription
meta.flightFileNameStorage path of the source flight
meta.sequenceFolderNameSequence folder name, if assigned
OLANOpenAero sequence text
figuresCountNumber of figures in the sequence
totalKTotal K factor for the sequence
scoresFigure scores from the database
latitude, longitude, altitudeJudge position
distance, headingJudge distance to box edge and true heading
categoryAerobatic category
airplaneModelSelected airplane model
pitchAdjustment, rollAdjustment, headingAdjustmentAlignment corrections (°)
verticalAdjustment, horizontalAdjustment, scaleAdjustmentPosition and scale corrections
sampleRateData sample rate (Hz)
figureMarkersFigure 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, ADC0ADC7

Each subsequent row is one time sample from the (optionally cropped) flight.

Download button vs API

FeatureAnalysis Download buttonAPI
Output formatCSV (+ .dat for admins)CSV only
Crop rangeUses current crop handles in AnalysiscropStart / cropEnd query params
Judge & adjustmentsCurrent Analysis session valuesValues from stored flight metadata
AuthenticationClerk 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.