NAV Navbar
shell JavaScript json


Welcome to the Streetlytics API. You can use our API to access API endpoints, which can get information on the APIs.

We have language bindings in Shell. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

You can see and test example API calls here.


The Streetlytics API uses JSON Web Tokens (JWTs) for authorization. The first call the user should make should be either /getToken with a username and password to receive a new api key or /isValidToken to ensure their existing key is still valid. The user should then form a token by preceeding the key with ‘jwt’. All tokens take the form ‘jwt APIKEY’ where APIKEY is returned by the getToken call. Note, the javascript client will automatically prepend API keys with jwt. Afterwards, all calls indicated as requiring authorization should set the Authorization header of the request with the JWT.


Where not indicated, a blank response with status 200 indicates success


This is an API call for segments.

[POST] /segments shell curl -X POST -H 'Content-Type:application/json' -H 'Authorization:jwt $APIKEY' -d '{"lng":$LNG, "lat":$LAT}' $BASEURL:5000/segments

  // Example 200 response
    p: {
      attributes: [
      num_segments: 50,
      paging: {
        num_segments: 0,
        page_number: 1,
        segments_per_page: 10000,
        total_pages: 1,
        total_segments: 1281
      segments: ["the attributes above, in the same order"]
    success: true,
    user_data: null
getSegmentsBbox(apiKey, west, south, east, north)
Parameter Type Required Default Description
segments_result_type string false COMPRESSED Choose how to display the results data. options COMPRESSED, COMPRESSED_NO_ATTRIBUTE_NAMES, PURE_GEOJSON
segments_limit int false 10000 Limits the segment list ex. 500
paging boolean false false Whether to show pagination
search_type string false point Search by point or bbox. bbox parameter must be in BBOX format
dir string false none Filters by selected direction
road_name string false none Restricts search to roads with specified name
road_name_match_type string false none How to match against the provided road name. Options: EXACT, LEFT_MATCH, IS_NOT_EXACT, EXACT_WITH_DIR_PREFIXES
func_classes int false none Use a function class of 1 to 5
lat float false none latitude of a point
lng float false none longitude of a point
radius float false 0 radius to search withing
bbox string false none string of four floats seperated by commas that represent a bounded box


if the segment_result_type is point (default), lat and lng are required. if segment_result_type is bbox, bbox is required

Get token

This is an API call that allows the user to create a token.

[POST] /getToken shell curl -X POST -H 'Content-Type:application/json' -d '{"username":"$USERNAME", "password":"$PASSWORD"}' $BASEURL:5000/getToken

    token: ""
getToken(username, password)


Parameter Type Default Description
username string None The user who is to receive the token
password string None User password
persist boolean False Determines whether to use a temporary token, or a long-term token


There are two types of tokens: a temporary token and a long-term token. The long-term token can be set by passing the boolean value True to the parameter persist. The default token is the temporary one.

There is a maximum number of persisted tokens available.

Is valid token

If the user is logged in this will return a blank 200 status response. Otherwise it will return a 401, unauthorized

[POST] /isValidToken shell curl -X POST -H 'Content-Type:application/json' -H 'Authorization:jwt $APIKEY' $BASEURL:5000/isValidToken javascript isValidToken(apiKey)


Get Persisted Tokens

Returns all persisted tokens for the current user

[POST] /getPersistedTokens shell curl -X POST -H 'Content-Type:application/json' -H 'Authorization:jwt $APIKEY' $BASEURL:5000/getPersistedTokens javascript getPersistedTokens(apiKey) json { "tokens": [ { "expires_on": $EPOCH, "token": "$TOKEN" } ] }

Revoke Persisted Token

Revokes a token for the current user

[Post] /revokePersistedToken

Parameter Type Description
token String the token to be revoked


the token passed should NOT be preceeded by ‘jwt’

curl -X POST -H 'Content-Type:application/json' -H 'Authorization:jwt $APIKEY' -d '{"token":"$APIKEY"}'  $BASEURL:5000/revokePersistedToken
revokePersistedToken(apiKey, token)

Change password

Changes password of the current user.

[POST] /changePassword

Parameter Type Description
new_password String The new password for the current user
curl -X POST -H 'Content-Type:application/json' -H 'Authorization:jwt $APIKEY' -d '{"new_password":"$PASSWORD"}'  $BASEURL:5000/changePassword


The new password must meet complexity requirements.

changePassword(apiKey, new_password)

Forgot password

Generates a new password and sends an email to the specified customer.

[POST] /forgotPassword

Parameter Type Description
username string Email address of user
curl -X POST -H 'Content-Type:application/json' -d '{"email":"$email"}' $BASEURL:5000/forgotPassword


If the user exists, a newly generated password is sent to the email address on file.


The Streetlytics API uses the following error codes:

Error Code Meaning
400 Bad Request – Information sent is invalid
401 Unauthorized – Authorization credentials are invalid