Requesting Metrics
StreetLight InSight® API
After an analysis completes, you request the specific metrics to be returned in a CSV format with the following endpoints:
You request metrics with strings that correspond to the types of metrics available with an analysis. You can check the strings for metrics available with an analysis with the Check analysis status endpoint.
The strings used to request metrics depend on the analysis type, travel mode, and metrics. For example, for a Zone Activity analysis with the All Vehicles LBS+ with traveler attributes, you would request za_all
to get trip metrics for the analysis. "za" represents Zone Activity, and "all" represents All Vehicles LBS+. You could then request zone_traveler_employment_all to get metrics for the employment traveler attribute in each zone.
The following is an example response for a Check analysis status query:
{
"analyses": [
{
"metrics": [
"od_all",
"zone_od_all",
"od_traveler_equity_all",
"zone_traveler_equity_all",
"od_traveler_household_all",
"zone_traveler_household_all",
"od_traveler_education_income_all",
"zone_traveler_education_income_all",
"od_traveler_trip_purpose_all",
"zone_traveler_trip_purpose_all",
"sample_size"
],
"name": "OriginDestination_MyCity",
"status": "Available",
"uuid": "1be1edc3-7575-4003-850c-62145f4986cb"
}
],
"status": "success"
}
Travel Mode
Most metric strings will have a suffix for the travel mode of the analysis. These strings are added to the analysis type strings below for a complete metric request string.
all
: All Vehiclescomm
: Truckbike
: Bicycleped
: Pedestrianbus
: Busrail
: Rail
Traveler Attributes
If your analysis includes traveler attributes, you request the category of traveler attribute in your metric request. These strings are added to the analysis type strings below for a complete metric request string.
For more information in the StreetLight Help Center, see Traveler Attributes .
equity
: Includes the self-identified equity demographics for travel at the zones.education_income
: Includes education and income demographics for travel in the analysis or zones.household
: Includes the household demographics for travel at the zones.employment
: This metric contains the employment demographics for travel at the zones.trip_purpose
: Represents the purpose of travel and can be any of the following:- Home-Based Work (HBW): travel between home and work in either direction.
- Home-Based Other (HBO): travel to or from home, to anywhere other than work.
- Non-Home Based (NHB): all travel not to or from home (i.e. all travel other than the above)
Trip Attributes
Metrics strings with trip
contain trip attributes for the analysis.
Some analysis types will include a zone_trip_[Travel Mode]
set of metrics, which contains trip attributes for individual zones.
Home and Work Locations
You can get metrics for home and work locations with the Zone Activity analysis type.
For more information in the StreetLight Help Center, see Home and Work Location Methodology .
In the metrics strings below, [Travel Mode] represents the travel mode string described above. [Traveler Attribute] represents the traveler attribute category described above.
home_grid_[Travel Mode]
: Lists the distribution of home locations of the trips to the zones, by 1 km by 1km grid cells.work_grid_[Travel Mode]
: Lists the distribution of work locations of the trips to the zones, by 1 km by 1km grid cells.home_metro_area_[Travel Mode]
: Lists the distribution of the home locations of the trips to the zones, by metro area as defined in the 2020 US Census.home_state_[Travel Mode]
: Lists the distribution of the home locations of the trips to the zones, by state.home_zip_codes_[Travel Mode]
: Lists the distribution of the home locations of the trips to the zones, by state.home_zip_codes_top_[Travel Mode]
: Lists the top home zip codes of visitors to the zones.tourist_summary_[Travel Mode]
: Includes the percentage split of visitors to the zone by state and metro area. For state the split is by In and Out-of-State visitors. For Metro Area the split is by Local Metro Area, Other Metro Area, and Rural Area.home_distance_[Travel Mode]
: The distance between trips' home locations and the zone they visit.work_distance_[Travel Mode]
: The distance between trips' work locations and the zone they visit.home_block_groups_[Travel Mode]
: Lists the distribution of the home locations of the trips to the zones, by 2020 census block group.work_block_groups_[Travel Mode]
: Lists the distribution of the work locations of the trips to the zones, by 2020 census block group.
Sample Size
sample_size
: Includes the size of the data sample that was analyzed for this analysis and its data period.
Prediction Interval
prediction_interval
: Includes prediction interval metrics that represent the range within which we expect the true value to lie 95% of the time and are formed using the 2.5th percentile and the 97.5th percentile of the error distribution.
Updated 7 days ago