flowcount

GET https://tern.retail.roofstreet.io/api/v1/flowcount

Based on a given place, timing and day-of-week it returns the amount of pedestrians or the amount of motorized individuals.

The place could be given either

  • in lat/lon coordinates : in that case the return maybe empty as there could be no measure at the place. To Ensure a valid anszwer the GID parameter returned by neighboursgrid will ensure a valid measure zone.

or

  • in gid reference : in that case the quality is computed at the Hexagon given precision 50 meters

if both lat/lon and gid are given, only gid will be used.

Parameters

Parameter Type Usage
lon float (-180 to 180) WSG84 Longitude (e.g. 2.4290276323522635 for Paris)
lat float (-90 to 90) WSG84 Latitude (e.g. 48.85225019822305 for Paris)
gid bigint GID given by a call to neighboursgrid
flowtype text Type of flow to measure (default = "pedestrian")
pedestrian : The API will return a 0 to 5 indicator depending on the amount of pedestrians
motorized : The API will return a 0 to 5 indicator depending on the amount of motorized individual
day text One of the day-of-week acceptable value : monday, tuesday, wednesday, thursday, friday, saturday, sunday
hour integer (from 0 to 23) One of the hour-of-the-day acceptable value (0 meaning from midight to 1:00am, 1 meaning from 1:00am to 2:00am, 20 meaning from 8:00pm to 9:00 pm)

if both lat/lon and gid are given, only gid will be used.

Returns : JSON Object

{
    "success" : true|false,
    "error" : "error message",
    "flowcount" : 123456
}
Value Type Usage
success boolean True if the call was succesfull
error string If success is false, the reason of the failure
flowcount integer the estimated amount of individuals (motorized or pedestrians) in the selected timescale

Usage / Example

With basic auth :

curl --user 'APIKEY:APISECRET' --basic  "https://tern.retail.roofstreet.io/api/v1/flowcount?lon=2.4290276323522635&lat=48.85225019822305&flowtype=pedestrian&day=monday&hour=12"

Auth in URL :

curl "https://tern.retail.roofstreet.io/api/v1/flowcount?lon=2.4290276323522635&lat=48.85225019822305&flowtype=pedestrian&day=monday&hour=12&apikey=APIKEY&apisecret=APISECRET"

Performance

At the first call to coordinates and timescale, the system must wake-up a lot of data. So the first call to that API will take up to 11 seconds depending on the traffic.

Subsequent calls to the same site and timescale will take less than 300 ms