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.
Parameter Type Required Description dep_bodyintYes Departure body ID (1-8) arr_bodyintYes Arrival body ID (1-8) dep_timestringYes Departure time (ISO 8601) arr_timestringYes Arrival time (ISO 8601)
ID Planet 1 Mercury 2 Venus 3 Earth 4 Mars 5 Jupiter 6 Saturn 7 Uranus 8 Neptune
"departure_body" : " Earth " ,
"departure_time" : " 2028-05-01T00:00:00Z " ,
"arrival_time" : " 2029-01-15T00:00:00Z " ,
"c3_departure_km2s2" : 12.4 ,
"v_inf_departure_km_s" : 3.52 ,
"v_inf_arrival_km_s" : 2.95 ,
Field Type Description 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
"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 " ,
Field Type Default Description departure_bodyint— Departure body ID (1-8, required) arrival_bodyint— Arrival body ID (1-8, required) dep_startstring— Start of departure date range (ISO 8601, required) dep_endstring— End of departure date range (ISO 8601, required) arr_startstring— Start of arrival date range (ISO 8601, required) arr_endstring— End of arrival date range (ISO 8601, required) dep_stepint5Departure date grid spacing in days arr_stepint5Arrival date grid spacing in days
"departure_body" : " Earth " ,
"departure_time" : " 2028-04-01 00:00:00+00 " ,
"arrival_time" : " 2028-12-01 00:00:00+00 " ,
"departure_time" : " 2028-04-01 00:00:00+00 " ,
"arrival_time" : " 2028-12-06 00:00:00+00 " ,
"departure_time" : " 2028-04-06 00:00:00+00 " ,
"arrival_time" : " 2028-12-01 00:00:00+00 " ,
"optimal_departure" : " 2028-05-15 00:00:00+00 " ,
"optimal_arrival" : " 2029-01-20 00:00:00+00 "
Field Type Description 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:
Transfer Typical C3 (km²/s²) Notes Earth → Mars 8-15 Most common interplanetary target Earth → Venus 5-12 Lower C3 due to closer proximity Earth → Jupiter 75-90 Requires heavy-lift vehicle or gravity assists Earth → Mercury 50-100+ Often uses Venus gravity assists to reduce C3