Skip to content

Interplanetary Transfer API

The Interplanetary Transfer API solves Lambert’s problem for ballistic transfers between solar system planets. It provides both single-solution computation and grid-based pork chop plot generation for visualizing optimal launch windows. All orbital mechanics calculations use pg_orrery’s lambert_transfer() and lambert_c3() SQL functions.

Compute a single Lambert transfer solution between two planets for a given departure and arrival time.

GET /api/transfer/solve
ParameterTypeRequiredDescription
dep_bodyintYesDeparture body ID (1-8)
arr_bodyintYesArrival body ID (1-8)
dep_timestringYesDeparture time (ISO 8601)
arr_timestringYesArrival time (ISO 8601)
IDPlanet
1Mercury
2Venus
3Earth
4Mars
5Jupiter
6Saturn
7Uranus
8Neptune
{
"departure_body": "Earth",
"arrival_body": "Mars",
"departure_time": "2028-05-01T00:00:00Z",
"arrival_time": "2029-01-15T00:00:00Z",
"c3_departure_km2s2": 12.4,
"c3_arrival_km2s2": 8.7,
"v_inf_departure_km_s": 3.52,
"v_inf_arrival_km_s": 2.95,
"tof_days": 259.0,
"transfer_sma_au": 1.31
}
FieldTypeDescription
departure_bodystringDeparture planet name
arrival_bodystringArrival planet name
departure_timestringISO 8601 departure timestamp
arrival_timestringISO 8601 arrival timestamp
c3_departure_km2s2floatDeparture characteristic energy (km²/s²)
c3_arrival_km2s2floatArrival characteristic energy (km²/s²)
v_inf_departure_km_sfloatDeparture hyperbolic excess velocity (km/s)
v_inf_arrival_km_sfloatArrival hyperbolic excess velocity (km/s)
tof_daysfloatTime of flight in days
transfer_sma_aufloatTransfer orbit semi-major axis in AU

Solve an Earth→Mars transfer departing May 2028, arriving January 2029:

GET /api/transfer/solve?dep_body=3&arr_body=4&dep_time=2028-05-01T00:00:00Z&arr_time=2029-01-15T00:00:00Z

Generate a grid of departure C3 values across a range of departure and arrival dates. The resulting data can be contour-plotted to identify optimal launch windows — regions of low C3 form the characteristic “pork chop” shape.

POST /api/transfer/porkchop
{
"departure_body": 3,
"arrival_body": 4,
"dep_start": "2028-04-01T00:00:00Z",
"dep_end": "2028-08-01T00:00:00Z",
"arr_start": "2028-12-01T00:00:00Z",
"arr_end": "2029-06-01T00:00:00Z",
"dep_step": 5,
"arr_step": 5
}
FieldTypeDefaultDescription
departure_bodyintDeparture body ID (1-8, required)
arrival_bodyintArrival body ID (1-8, required)
dep_startstringStart of departure date range (ISO 8601, required)
dep_endstringEnd of departure date range (ISO 8601, required)
arr_startstringStart of arrival date range (ISO 8601, required)
arr_endstringEnd of arrival date range (ISO 8601, required)
dep_stepint5Departure date grid spacing in days
arr_stepint5Arrival date grid spacing in days
{
"departure_body": "Earth",
"arrival_body": "Mars",
"cells": [
{
"departure_time": "2028-04-01 00:00:00+00",
"arrival_time": "2028-12-01 00:00:00+00",
"c3_km2s2": 18.3
},
{
"departure_time": "2028-04-01 00:00:00+00",
"arrival_time": "2028-12-06 00:00:00+00",
"c3_km2s2": 16.1
},
{
"departure_time": "2028-04-06 00:00:00+00",
"arrival_time": "2028-12-01 00:00:00+00",
"c3_km2s2": 15.7
}
],
"min_c3": 8.2,
"optimal_departure": "2028-05-15 00:00:00+00",
"optimal_arrival": "2029-01-20 00:00:00+00"
}
FieldTypeDescription
departure_bodystringDeparture planet name
arrival_bodystringArrival planet name
cellsarrayGrid of C3 values for each departure/arrival combination
cells[].departure_timestringDeparture timestamp for this grid cell
cells[].arrival_timestringArrival timestamp for this grid cell
cells[].c3_km2s2floatDeparture C3 for this transfer (km²/s²)
min_c3floatLowest C3 value found in the grid (km²/s²)
optimal_departurestringDeparture time corresponding to min_c3
optimal_arrivalstringArrival time corresponding to min_c3

For context on what the C3 numbers mean in practice:

TransferTypical C3 (km²/s²)Notes
Earth → Mars8-15Most common interplanetary target
Earth → Venus5-12Lower C3 due to closer proximity
Earth → Jupiter75-90Requires heavy-lift vehicle or gravity assists
Earth → Mercury50-100+Often uses Venus gravity assists to reduce C3