Skip to content

Travel Barometer Index Compare

Travel Barometer Index Compare API returns two different index scores at once for specified {Viewport} and {Location}: one defined by the specifieddate query parameter and another defined by compare_ prefixed query parameters (or auto-calculated with default values where specified).
Additional comparative data between the two index scores is returned as well.

Request

Endpoint

GET /v4/{billing_plan}/account/{account_id}/maps/index/travel_barometer/compare

Path Parameters

Name                       Description Type Examples
*{billing_plan} Billing plan to be applied to the call. string ondemand
*{account_id} Provided identifier of the account. string

Header Parameters

Name                          Description Type Examples                         
*x-api-key Provided API key {x_api_key} that allows authentication. string
*Authorization Provided token {jwt_bearer} that allows authorization. string Bearer {jwt_bearer}

Query Parameters

Name                                           Description Type Examples                 Default
*{Viewport} Viewport identifier. Viewport Viewport
*{Location} Actual location identifier. Geospatial Area
GeometryID
Circle
*date Day for which index actual score is requested. date 2021-01-31
compare_date Day for which index comparison score is requested. date 2021-01-31 One year before date.
network
compare_network
Filter by network. string Dictionary
poi_class
compare_poi_class
Filter POIs with "category": "hotel" by stars rating in the range [1,5]. int 4
poi_category
compare_poi_category
Filter by POI Category. string Dictionary
user_type
compare_user_type
Filter by reviewer type. string Dictionary
user_country
compare_user_country
Filter by reviewer's country of origin in ISO 3166-1 alpha-2 standard format (in lower case). string it
de
content_language
compare_content_language
Filter by contents language in ISO_639-1 standard format. string en
fr
content_type
compare_content_type
Filter by type of content. string post
review
taggedpost
review && taggedpost
Example
curl -X GET 'https://api.datappeal.io/v4/ondemand/account/{account_id}/maps/index/travel_barometer/compare?country=italy&state=toscana&county=prato&date=2021-07-01&sw_lat=43.06888777416961&sw_lng=8.4375&se_lat=43.06888777416961&se_lng=11.25&ne_lat=45.08903556483103&ne_lng=11.25&nw_lat=45.08903556483103&nw_lng=8.4375' \
-H 'x-api-key: {x_api_key}' \
-H 'Authorization: Bearer {jwt_bearer}' \

Response

Status

Status Description
200 Travel Barometer Index Compare data has been successfully returned.

Body

MapsComparedIndex

Field Description Type
actual Map quads index scores for the actual timeframe. MapsComparableIndex
comparison Map quads index scores for the comparison timeframe. MapsComparableIndex
variation Calculated difference between actual and comparison. array[MapsIndexVariation]
MapsComparableIndex
Field Description Type
timeframe Reference date range. Timeframe
value Map quads index scores for the corresponding timeframe. array[MapsIndexDateScore]
Timeframe
Field Description Type
*from Start date of timeframe. date
*to End date of timeframe. date
MapsIndexDateScore
Field Description Type
*index Index data of corresponding quadkey. LocationIndexDateScore
*quadkey Identifier of the map quad. Quadkey
LocationIndexDateScore
Field Description Type
date Date representing the day score refers to.
It could differ by the requested date for calculation resolution reasons.
date
score Index score value in the range [0,100]. decimal
Quadkey
Field Description Type Examples
*tile Map quad identifier in Bing Maps Tile System standard format. string 1202231311
*wkt Map quad expressed in WKT standard format. string POLYGON ((10.8984375 43.83452678223682, 11.25 43.83452678223682, 11.25 44.087585028245165, 10.8984375 44.087585028245165, 10.8984375 43.83452678223682))
MapsIndexVariation
Field Description Type
*index Index score variation of corresponding quadkey. Variation
*quadkey Identifier of the map quad. Quadkey
Variation
Field Description Type Examples
value Difference between actual value and comparison value. decimal 1.12
variation The explicit variation polarity.
It is null when values are not available in both timeframes.
string POSITIVE
NEUTRAL
NEGATIVE
Quadkey
Field Description Type Examples
*tile Map quad identifier in Bing Maps Tile System standard format. string 1202231311
*wkt Map quad expressed in WKT standard format. string POLYGON ((10.8984375 43.83452678223682, 11.25 43.83452678223682, 11.25 44.087585028245165, 10.8984375 44.087585028245165, 10.8984375 43.83452678223682))
Example
{
    "actual": {
        "timeframe": {
            "date": "2021-07-01"
        },
        "value": [
            {
                "index": {
                    "score": 77.57,
                    "date": "2021-06-28"
                },
                "quadkey": {
                    "tile": "1202231311",
                    "wkt": "POLYGON ((10.8984375 43.83452678223682, 11.25 43.83452678223682, 11.25 44.087585028245165, 10.8984375 44.087585028245165, 10.8984375 43.83452678223682))"
                }
            },
            {
                "index": {
                    "score": 88.79,
                    "date": "2021-06-28"
                },
                "quadkey": {
                    "tile": "1202231133",
                    "wkt": "POLYGON ((10.8984375 44.087585028245165, 11.25 44.087585028245165, 11.25 44.339565248097124, 10.8984375 44.339565248097124, 10.8984375 44.087585028245165))"
                }
            },
            {
                "index": {
                    "score": 84.0,
                    "date": "2021-06-28"
                },
                "quadkey": {
                    "tile": "1202231313",
                    "wkt": "POLYGON ((10.8984375 43.58039085560784, 11.25 43.58039085560784, 11.25 43.83452678223682, 10.8984375 43.83452678223682, 10.8984375 43.58039085560784))"
                }
            }
        ]
    },
    "comparison": {
        "timeframe": {
            "date": "2020-07-01"
        },
        "value": [
            {
                "index": {
                    "score": 65.68,
                    "date": "2020-06-29"
                },
                "quadkey": {
                    "tile": "1202231311",
                    "wkt": "POLYGON ((10.8984375 43.83452678223682, 11.25 43.83452678223682, 11.25 44.087585028245165, 10.8984375 44.087585028245165, 10.8984375 43.83452678223682))"
                }
            },
            {
                "index": {
                    "score": 94.47,
                    "date": "2020-06-29"
                },
                "quadkey": {
                    "tile": "1202231133",
                    "wkt": "POLYGON ((10.8984375 44.087585028245165, 11.25 44.087585028245165, 11.25 44.339565248097124, 10.8984375 44.339565248097124, 10.8984375 44.087585028245165))"
                }
            },
            {
                "index": {
                    "score": 50.64,
                    "date": "2020-06-29"
                },
                "quadkey": {
                    "tile": "1202231313",
                    "wkt": "POLYGON ((10.8984375 43.58039085560784, 11.25 43.58039085560784, 11.25 43.83452678223682, 10.8984375 43.83452678223682, 10.8984375 43.58039085560784))"
                }
            }
        ]
    },
    "variation": [
        {
            "index": {
                "value": 11.89,
                "variation": "POSITIVE"
            },
            "quadkey": {
                "tile": "1202231311",
                "wkt": "POLYGON ((10.8984375 43.83452678223682, 11.25 43.83452678223682, 11.25 44.087585028245165, 10.8984375 44.087585028245165, 10.8984375 43.83452678223682))"
            }
        },
        {
            "index": {
                "value": -5.68,
                "variation": "NEGATIVE"
            },
            "quadkey": {
                "tile": "1202231133",
                "wkt": "POLYGON ((10.8984375 44.087585028245165, 11.25 44.087585028245165, 11.25 44.339565248097124, 10.8984375 44.339565248097124, 10.8984375 44.087585028245165))"
            }
        },
        {
            "index": {
                "value": 33.36,
                "variation": "POSITIVE"
            },
            "quadkey": {
                "tile": "1202231313",
                "wkt": "POLYGON ((10.8984375 43.58039085560784, 11.25 43.58039085560784, 11.25 43.83452678223682, 10.8984375 43.83452678223682, 10.8984375 43.58039085560784))"
            }
        }
    ]
}