1

I'm trying to get the TOMTOM trafficstats api working and not getting the response I expected. I'm using Postman to generate a POST request to https://{{baseURL}}/traffic/trafficstats/routeanalysis/{{versionNumber}}?key={{apiKey}}

I've set the versionNumber =1 and the key='my TOMTOM access key'. The documentation says that the baseURL should be 'api.tomtom.com' , but I get a "developer inactive" response when doing so. However, if I use baseURL='move.tomtom.com', I get an html response.

I'm sending the following body trying to get historical traffic data on a street in San Francsico:

{
    "jobName":"Test job",
    "distanceUnit":"MILES",
    "routes":[
        {
            "name":"The Embarcadero",
            "start":{
                "latitude":37.794672,
                "longitude":-122.393938
            },
            "via":[
                {
                    "latitude":37.783319,
                    "longitude":-122.388037
                    }
            ],
            "end":{
                "latitude":37.775170,
                "longitude":-122.395783
            },
            "fullTraversal":false,
            "zoneId":"UTC",
            "probeSource":"ALL"
        }
    ],
    "dateRanges":[
        {
            "name":"First day of November",
            "from":"2010-11-01",
            "to":"2010-11-01"
        }
    ],
    "timeSets":[
        {
            "name":"Monday morning hour",
            "timeGroups":[
                {
                    "times":[
                        "7:00-8:00"
                    ]
                }
            ]
        }
    ]
}

The 'Content-Type' of my request header is set to 'application/json'.

I get the following html response. I don't see the expected json data in the body of the html. Any ideas on what I'm doing incorrectly?

 <!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
        <title>TomTom Move</title>
        <base href="/" />
        <link rel="shortcut icon" href="/favicon.png">
        <link href="/css/styles.1337aa094afbb0bd778a.css" rel="stylesheet">
        <link rel="preload" href="/js/styles.7c8029e7a8f45b1dd768.js" as="script">
        <link rel="preload" href="/js/main.2d6a744cf686a687271d.js" as="script">
        <link rel="preload" href="/js/vendors~main.0c1946201ec04090e7a7.js" as="script">
        <link rel="prefetch" href="/js/styles.7c8029e7a8f45b1dd768.js">
        <link rel="prefetch" href="/js/main.2d6a744cf686a687271d.js">
        <link rel="prefetch" href="/js/vendors~main.0c1946201ec04090e7a7.js">
    </head>
    <body>
        <div id="app"></div>
        <!-- Tealium script -->
        <script type="text/javascript">
        (function (a, b, c, d) {
            a = '//tags.tiqcdn.com/utag/tomtom/move/prod/utag.js';
            b = document; c = 'script'; d = b.createElement(c); d.src = a; d.type = 'text/java' + c; d.async = true;
            a = b.getElementsByTagName(c)[0]; a.parentNode.insertBefore(d, a);
        })();
    </script>
        <script type="text/javascript" src="/js/styles.7c8029e7a8f45b1dd768.js"></script>
        <script type="text/javascript" src="/js/main.2d6a744cf686a687271d.js"></script>
        <script type="text/javascript" src="/js/vendors~main.0c1946201ec04090e7a7.js"></script>
    </body>
</html>
user2108868
  • 91
  • 1
  • 9
  • TrafficStats is not a public API. So if you don't have an agreement with TomTom then you don't have an access to this API. For that kind of issues it is better to ask TomTom directly. – szogoon Feb 14 '19 at 13:11
  • Yeah. Thanks. I thought I had the correct API key. If you answer the question, I'll accept it. – user2108868 Feb 15 '19 at 15:11

1 Answers1

1

TrafficStats is not a public API. So if you don't have an agreement with TomTom then you don't have an access to this API. For that kind of issues it is better to ask TomTom directly.

And valid baseUrl for TomTom APIs is api.tomtom.com

szogoon
  • 470
  • 3
  • 15
  • Thanks. Are you aware of any sites that amalgamate research traffic into this API so that researchers don't have to try and talk TomTom into small volume access? – user2108868 Feb 16 '19 at 18:18
  • Sorry, but don't have much experience with other service providers. – szogoon Feb 18 '19 at 08:48
  • What kind of data do you need? TomTom Routing API is calculating the route taking into account historical traffic. You can also retrieve free flow travel time and calculate that difference. I know that it is not a perfect solution, but maybe helps a bit. – szogoon Feb 18 '19 at 08:54
  • I want to build a multivariate model for a couple of street speeds at rush hour from around 2008 through 2018. My objective is to check SFMTA's assertion that Uber is responsible for 51% of the congestion from 2010-2016. Got to start with some street speed data... – user2108868 Feb 19 '19 at 18:11