Introduction
API Endpoints Reference
This section provides comprehensive documentation for all Travel Demand API endpoints. All endpoints require authentication via the x-api-key header.
Base URL
https://api.zytlyn.comEndpoint Categories
The API is organized into four main categories:
Route Prediction - Get demand predictions for specific routes
Route Historical Data - Access historical demand data
Route Subscription - Manage and view your subscriptions
Route Lead Time Prediction - Analyze lead time patterns
Route Prediction
Endpoints for demand predictions between specific origin-destination pairs.
Get Route Demand Prediction
Retrieves travel demand predictions for a specified route, product dimension, and time resolution.
Endpoint
Parameters
product_dimension
string
✅
The product dimension for predictions
time_resolution
string
✅
Temporal granularity of prediction data
origin
string
✅
3-letter IATA code for origin city
destination
string
✅
3-letter IATA code for destination city
Parameter Values
product_dimension:
search_date,travel_date,lead_timetime_resolution:
monthly,weekly,dailyorigin/destination: 3-letter IATA codes (e.g.,
LON,BCN,NYC)
Example Request
Success Response (200)
Error Responses
401 Unauthorized: Invalid or missing API key
422 Validation Error: Invalid parameters
Route Historical Data
Endpoints for accessing historical demand data between specific origin-destination pairs.
Get Route Demand History
Retrieves historical data for a specific flight route based on product dimension and time resolution.
Endpoint
Parameters
product_dimension
string
✅
The type of date for historical data
time_resolution
string
✅
Granularity of historical data
origin
string
✅
3-letter IATA code for origin city
destination
string
✅
3-letter IATA code for destination city
Parameter Values
product_dimension:
search_date,travel_date,lead_timetime_resolution:
monthly,weekly,dailyorigin/destination: 3-letter IATA codes
Example Request
Success Response (200)
Route Subscription
Endpoints to access the list of routes to which you are subscribed.
Get Route Subscriptions
Retrieves all subscription configurations related to route-based predictions.
Endpoint
Parameters
This endpoint requires no parameters.
Example Request
Success Response (200)
Subscription Fields
product_dimension
The product dimension for this subscription
time_resolution
Time granularity available
georesolution
Geographic resolution (always "route")
historical_data_range
Months of historical data available
prediction_horizon
Months of predictions available
targets
Array of origin-destination pairs you can access
Route Lead Time Prediction
Endpoints for lead time demand predictions between specific origin-destination pairs.
Get Route Lead Time Demand Prediction
Retrieves travel demand lead time predictions for a specified route and time resolution.
Endpoint
Parameters
time_resolution
string
✅
Temporal granularity of prediction data
origin
string
✅
3-letter IATA code for origin city
destination
string
✅
3-letter IATA code for destination city
Parameter Values
time_resolution:
monthly,weekly,dailyorigin/destination: 3-letter IATA codes
Example Request
Success Response (200)
Lead Time Buckets
Lead time data is provided in specific buckets representing days before travel:
0_1
Searches 0-1 days before travel
1_2
Searches 1-2 days before travel
2_3
Searches 2-3 days before travel
3_4
Searches 3-4 days before travel
4_5
Searches 4-5 days before travel
5_6
Searches 5-6 days before travel
6_7
Searches 6-7 days before travel
7_14
Searches 7-14 days before travel
14_21
Searches 14-21 days before travel
21_30
Searches 21-30 days before travel
30_60
Searches 30-60 days before travel
60_90
Searches 60-90 days before travel
90+
Searches 90+ days before travel
Common Error Responses
400 Bad Request
When trying to get data with a subscription that doesn't allow it, you'll receive a 400 Bad Request response with a detailed message:
Common causes:
Trying to get data with a subscription that doesn't allow it
422 Unprocessable Entity
When the request is malformed, you'll receive a 422 Unprocessable Entity response with a detailed message:
Common causes:
Invalid or malformed request
Missing required parameters
Invalid parameter values (e.g. invalid IATA code)
SDKs and Tools
cURL Examples
All examples in this documentation use cURL for simplicity. Replace your-api-key-here with your actual API key.
Testing
Use the subscription endpoint to test your API access and view available routes before making prediction or historical data requests.
Last updated
