Search and analyze flights with jetlag scoring for healthier travel.
Set AEROBASE_API_KEY as an environment variable:
bash
export AEROBASE_API_KEY="ak_xxxxxxxx"
Get your API key from https://aerobase.app/connect
text
https://aerobase.app/api
Find flights between destinations with jetlag scoring.
Command:
bash
curl -X POST https://aerobase.app/api/v1/flights/search \
-H "Authorization: Bearer $AEROBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "LAX",
"to": "NRT",
"date": "2026-04-15",
"cabin": "economy",
"sort": "jetlag",
"limit": 10
}'
Parameters:
ParameterTypeDescriptionfromstringOrigin IATA code (e.g., LAX)tostringDestination IATA code (e.g., NRT)datestringDeparture date (YYYY-MM-DD)returnDatestringOptional return datecabinstringeconomy, premium_economy, business, firstsortstringjetlag, price, durationlimitnumberResults to return (free=5, pro=50)
Response includes: flight details + jetlag_score, recovery_days, direction
Get detailed jetlag analysis for a specific flight.
Command:
bash
curl -X POST https://aerobase.app/api/v1/flights/score \
-H "Authorization: Bearer $AEROBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "LAX",
"to": "NRT",
"departure": "2026-04-15T08:00:00-07:00",
"arrival": "2026-04-16T14:30:00+09:00",
"cabin": "business"
}'
Parameters:
ParameterTypeDescriptionfromstringOrigin IATA codetostringDestination IATA codedeparturestringISO 8601 with offsetarrivalstringISO 8601 with offsetcabinstringeconomy, premium_economy, business, firstchronotypestringearly_bird, night_owl, normal
Response includes:
Compare 2-10 flights side by side.
Command:
bash
curl -X POST https://aerobase.app/api/v1/flights/compare \
-H "Authorization: Bearer $AEROBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flights": [
{"from": "JFK", "to": "LHR", "departure": "2026-04-15T18:00:00-04:00", "arrival": "2026-04-16T07:00:00+01:00", "label": "Evening departure"},
{"from": "JFK", "to": "LHR", "departure": "2026-04-15T22:00:00-04:00", "arrival": "2026-04-16T11:00:00+01:00", "label": "Red-eye"}
]
}'
Generate personalized jetlag recovery plan.
Command:
bash
curl -X POST https://aerobase.app/api/v1/recovery/plan \
-H "Authorization: Bearer $AEROBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "LAX",
"to": "NRT",
"departure": "2026-04-15T08:00:00-07:00",
"arrival": "2026-04-16T14:30:00+09:00",
"arrival_commitments": [
{"event": "Board Meeting", "time": "2026-04-17T09:00:00+09:00"}
]
}'
Response includes:
Find jetlag-scored travel deals.
Command:
bash
curl "https://aerobase.app/api/v1/deals?departure=LAX&max_price=600&sort=jetlag_score&limit=10" \
-H "Authorization: Bearer $AEROBASE_API_KEY"
Parameters:
ParameterTypeDescriptiondeparturestringOrigin IATA codedestinationstringDestination IATA codemax_pricenumberMaximum price in USDsortstringvalue_score, price, jetlag_score, newestlimitnumberResults (free=3, pro=50)
Get airport details with facilities.
Command:
bash
curl "https://aerobase.app/api/v1/airports/JFK" \
-H "Authorization: Bearer $AEROBASE_API_KEY"
Find jetlag-friendly hotels near airport.
Command:
bash
curl "https://aerobase.app/api/v1/hotels?airport=NRT&jetlagFriendly=true" \
-H "Authorization: Bearer $AEROBASE_API_KEY"
Find airport lounges.
Command:
bash
curl "https://aerobase.app/api/v1/lounges?airport=LHR" \
-H "Authorization: Bearer $AEROBASE_API_KEY"
Analyze multi-leg trips for cumulative jetlag.
Command:
bash
curl -X POST https://aerobase.app/api/v1/itinerary/analyze \
-H "Authorization: Bearer $AEROBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"legs": [
{"from": "LAX", "to": "NRT", "departure": "...", "arrival": "..."},
{"from": "NRT", "to": "SIN", "departure": "...", "arrival": "..."}
]
}'
ScoreTierRecovery80-100Excellent0-2 days60-79Good2-3 days40-59Moderate3-5 days20-39Poor5-7 days0-19Severe7+ days
All responses:
json
{
"data": { ... },
"meta": {
"request_id": "uuid",
"tier": "free|pro|concierge|api",
"calls_remaining": 95,
"latency_ms": 234
}
}
Common error codes:
TierDaily CallsFree100Pro1,000Concierge10,000APIUnlimited
Show the jetlag score prominently:
text
✈️ UA870 LAX → NRT
Score: 72/100 (Good) | Recovery: 3 days
Dep: 11:00 AM | Arr: 2:30 PM (+1 day)
💡 Red-eye aligns with natural sleep