Traffic estimates at specified time of day (for use in analytics)

4 posts / 0 new
Last post
hoaganalytics
Traffic estimates at specified time of day (for use in analytics)

All,

As far as I can tell, there is no way to utilize the route API to give me traffic estimates.  For example, I want to know drive time at 5:15 PM on an average Monday or 2:00 AM on an average Friday.  Passing useTraffic = true and other appropriate parameters, there is no change in output of drivetime.  I've tried configuring the call every which way (and I've confirmed that the API response has all my input parameters).

The only thing that has an effect on route/time is use of timeType = 1.  If I use this, then drive time will display for current traffic.  Oddly, it will be slightly different from the realTime output.

Am I to understand that Mapquest will only attempt to calculate things like HOV lanes and road closures?  If so, I can't say I'm not dissapointed... 

 

Sample:

LOAD

'$(L1NAME)' as I_L1NAME,

'$(L1LAT)' as I_L1LAT,

'$(L1LONG)' as I_L1LONG,

'$(L2NAME)' as I_L2NAME,

'$(L2LAT)' as I_L2LAT,

'$(L2LONG)' as I_L2LONG,

    trim([route/time]) as O_DRIVETIME,

    trim([route/formattedTime]) as O_FORMATTEDTIME,

    trim([route/realTime]) as O_REALTIME,

    trim([route/distance]) as O_DRIVEDISTANCE,

    trim([route/fuelUsed]) as O_FUELUSED,

    trim([route/options/useTraffic]) as O_TRAFFIC,

    trim([route/options/timeType]) as O_TIMETYPE,

    trim([route/options/localTime]) as O_LOCALTIME,

    trim([route/options/dateType]) as O_DATETYPE,

    [info/statusCode] as O_STATUSCODE

 

 

FROM

 

[https://www.mapquestapi.com/directions/v2/route?key=kekeke

 

&inFormat=xml

&outFormat=xml

&xml=

<route>

            <locations>

            

<location><latLng>

<lat>$(L1LAT)</lat>

<lng>$(L1LONG)</lng>

</latLng></location>

 

<location><latLng>

<lat>$(L2LAT)</lat>

<lng>$(L2LONG)</lng>

</latLng></location>

 

</locations>

 

<options>

 

<doReverseGeocode>false</doReverseGeocode>

<useTraffic>true</useTraffic>

 

<timeType>2</timeType>

<dateType>2</dateType>

<localTime>11:00</localTime>

 

</options>

</route>

] (XmlSimple, Table is [response])


MQBrianCoakley
The directions api should use

The directions api should use traffic by default. The values in time and realTime will differ when there is traffic data and the data affects the route. Can you post a specific sample request to www.mapquestapi.com/directions/v2 that is not performing as expected?


hoaganalytics
I'm having a lot of trouble

I'm having a lot of trouble posting the table into this HTML parser.

By the way, the MapQuest site support ticket system is broken; I'm an enterprise customer.  If you give me your email address, I can send you this excel.

 

yesterday
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 4 PM - timeType = 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.84614912
-118.0117066
902
0:15:02
950
12.278
0.58
FALSE
 
 
 
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.87424155
-117.9934604
725
0:12:05
731
10.742
0.51
FALSE
 
 
 
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 4 PM - timeType = 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.84614912
-118.0117066
902
0:15:02
950
12.278
0.58
TRUE
2
17:15
2
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.87424155
-117.9934604
725
0:12:05
731
10.742
0.51
TRUE
2
17:15
2
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 4 PM - timeType = 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.84614912
-118.0117066
948
0:15:48
950
12.278
0.62
TRUE
1
 
 
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.87424155
-117.9934604
730
0:12:10
731
10.742
0.56
TRUE
1
 
 
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

today
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 9:30 AM - timeType = 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
874
0:14:34
874
12.278
0.63
TRUE
1
 
 
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
784
0:13:04
783
10.742
0.58
TRUE
1
 
 
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 10:30 AM - timeType = 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
0:15:02
950
12.278
0.58
TRUE
2
18:00
4
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
0:12:05
764
10.742
0.51
TRUE
2
18:00
4
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 10:30 AM - timeType = 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
0:15:02
960
12.278
0.58
TRUE
2
17:15
2
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
0:12:05
774
10.742
0.51
TRUE
2
17:15
2
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 10:30 AM - timeType = 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
921
0:15:21
922
12.278
0.63
TRUE
1
 
 
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
777
0:12:57
777
10.742
0.57
TRUE
1
 
 
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 11:00 AM - useTraffic = FALSE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
0:15:02
905
12.278
0.58
FALSE
 
 
 
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
0:12:05
755
10.742
0.51
FALSE
 
 
 
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 11:00 AM - useTraffic = FALSE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
990
12.278
0.58
FALSE
 
 
 
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
719
10.742
0.51
FALSE
 
 
 
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 12 PM - timeType = 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
997
12.278
0.58
true
2
17:15
2
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
740
10.742
0.51
true
2
17:15
2
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
963
12.278
0.58
true
2
18:00
4
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
764
10.742
0.51
true
2
18:00
4
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
966
12.278
0.58
true
2
23:59
4
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
766
10.742
0.51
true
2
23:59
4
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
980
12.278
0.58
true
2
06:00
4
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
771
10.742
0.51
true
2
06:00
4
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
981
12.278
0.58
true
2
11:00
4
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
773
10.742
0.51
true
2
11:00
4
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Run at 12:15 PM - Use 03/05/2018
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
925
12.278
0.58
true
2
11:00
0
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
804
10.742
0.51
true
2
11:00
0
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
934
12.278
0.58
true
2
11:00
0
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
805
10.742
0.51
true
2
11:00
0
0

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I_L1NAME
I_L1LAT
I_L1LONG
I_L2NAME
I_L2LAT
I_L2LONG
O_DRIVETIME
O_FORMATTEDTIME
O_REALTIME
O_DRIVEDISTANCE
O_FUELUSED
O_TRAFFIC
O_TIMETYPE
O_LOCALTIME
O_DATETYPE
O_STATUSCODE

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90620
33.8461491225
-118.011706579
902
00:15:02
934
12.278
0.58
true
2
11:00
0
0

CHILDREN'S HOSPITAL OF ORANGE COUNTY
33.780331
-117.865189
90621
33.8742415484
-117.993460416
725
00:12:05
798
10.742
0.51
true
2
11:00
0
0

 


MQBrianCoakley
I emailed you directly at

I emailed you directly at your Developer Network email. Hopefully you've received it.