▪ Overall Grouped Compare
Rates Overall Grouped Compare API returns two, time-based rates overall grouped data sets along with a comparative calculation.
Request
Endpoint
GET
/v4/{billing_plan}/account/{account_id}/locations/rates/overall/grouped/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 | |
| /sample | Filter data for POIs that are included in the sample (subset of POIs that statistically replicates the population of the corresponding location). | string | 
/sample optional path parameter
Inserting optional path parameter /sample in the following position:
- /v4/{billing_plan}/account/{account_id}/locations/rates/sample/…
will filter data for POIs that are included in the sample (subset of POIs that statistically replicates the population of the corresponding location).
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 | 
|---|---|---|---|---|
| *{Location} | Actual location identifier. | Geospatial | AreaGeometryIDCircle | |
| *from | Start date of actual timeframe. | date | 2020-01-01 | |
| *to | End date of actual timeframe. | date | 2020-12-31 | |
| *group_type | Field for which perform grouping. | string | poi_industrypoi_categorypoi_class | |
| {ComparisonLocation} | Comparison location identifier. | Comparison | ComparisonAreaComparisonGeometryIDComparisonCircle | Same as {Location}. | 
| compare_from | Start date of comparison timeframe. | date | 2020-07-01 | One year before from. | 
| compare_to | End date of comparison timeframe. | date | 2021-01-01 | One year before to. | 
| ⓝ percentile | Request percentile expressed in the range (0, 1).Median value 0.5 will always be implicitly requested. | decimal | 0.5 | |
| ⓝ poi_classⓝ compare_poi_class | Filter POIs with "category": "hotel"by stars rating in the range [1,5]. | int | 4 | |
| ⓝ poi_industryⓝ compare_poi_industry | Filter by POI Industry. | string | Dictionary | |
| ⓝ poi_categoryⓝ compare_poi_category | Filter by POI Category. | string | Dictionary | |
| ⓝ facilityⓝ compare_facility | Filter offers by included facility. | string | breakfastlunchdinner | |
| guestscompare_guests | Filter offers by number of allowed guests. | int | 1 | 2 (only when group_typeis not equal toguests) | 
| refundablecompare_refundable | Filter offers that can be refunded. | boolean | truefalse | |
| scan_last_day | Filter data according to a less recent offers detection in the range [1,10] (from most recent to oldest offers detection day). | int | 5 | 1 (only when group_typeis not equal toscan_last_day) | 
| page | Requested page number for paginated results. | int | 1 | |
| page_size | Requested page size for paginated results in the range [1, 100]. | int | 25 | 
Supported values for group_type
- poi_industry
- poi_category
- poi_class
- guests
- scan_last_day
Supported values for facility
- breakfast
- lunch
- dinner
Example
curl -X GET 'https://api.datappeal.io/v4/ondemand/account/{account_id}/locations/rates/overall/grouped/compare?geometry_id=379c730942e570d586a5520770c0a65d&from=2021-01-01&to=2021-07-01&compare_from=2020-07-01&compare_to=2021-01-01&group_type=poi_class' \
-H 'x-api-key: {x_api_key}' \
-H 'Authorization: Bearer {jwt_bearer}' \
Example /sample
curl -X GET 'https://api.datappeal.io/v4/ondemand/account/{account_id}/locations/rates/sample/overall/grouped/compare?geometry_id=379c730942e570d586a5520770c0a65d&from=2021-01-01&to=2021-07-01&compare_from=2020-07-01&compare_to=2021-01-01&group_type=poi_class' \
-H 'x-api-key: {x_api_key}' \
-H 'Authorization: Bearer {jwt_bearer}' \
Response
Status
| Status | Description | 
|---|---|
| 200 | Rates Overall Grouped Compare data has been successfully returned. | 
Body
LocationRatesGroupedComparedOverall
| Field | Description | Type | 
|---|---|---|
| *results | Paginated grouped compared overall data. | LocationGroupedComparedOverallResults | 
| paging | Response pagination. | Paging | 
LocationRatesGroupedComparedOverallResults
| Field | Description | Type | 
|---|---|---|
| actual | Rates overall grouped data for the actual timeframe. | LocationRatesGroupedComparableOverall | 
| comparison | Rates overall grouped data for the comparison timeframe. | LocationRatesGroupedComparableOverall | 
| variation | Calculated difference between actualandcomparison. | array[LocationRatesGroupedOverallVariation] | 
LocationRatesGroupedComparableOverall
| Field | Description | Type | 
|---|---|---|
| timeframe | Reference date range. | Timeframe | 
| value | Rates overall grouped data for the corresponding timeframe. | array[LocationRatesGroupedOverallElement] | 
Timeframe
| Field | Description | Type | 
|---|---|---|
| *from | Start date of timeframe. | date | 
| *to | End date of timeframe. | date | 
LocationRatesGroupedOverallElement
| Field | Description | Type | 
|---|---|---|
| *group | Field value within the requested grouping by field. | string | 
| average | Average accommodation offers price in Euros. | decimal | 
| *percentiles | Accommodation offers percentiles values expressed in Euros. | array[Percentile] | 
| *poi | Count of POIs with accommodation offers within the group. | PartitionCount | 
Percentile
| Field | Description | Type | Examples | 
|---|---|---|---|
| *request | Requested percentile expressed in the range (0, 1), e.g. 0.5 (the median). | decimal | 0.5 | 
| *response | Resulting value of the requestpercentile. | decimal | 73.00 | 
PartitionCount
| Field | Description | Type | 
|---|---|---|
| partition | Count incidence percentage of the group's elements over total elements. | int | 
| count | Total elements of the group. | int | 
LocationRatesGroupedOverallVariation
| Field | Description | Type | 
|---|---|---|
| *group | Field value within the requested grouping by field. | string | 
| average | Average accommodation offers price variation in Euros. | Variation | 
| *percentiles | Accommodation offers percentiles variations expressed in Euros. | array[PercentileVariation] | 
| poi | Count variation of POIs with accommodation offers within the group. | PartitionVariation | 
Variation
| Field | Description | Type | Examples | 
|---|---|---|---|
| value | Difference between actualvalue andcomparisonvalue. | decimal | 1.12 | 
| variation | The explicit variation polarity. It is nullwhen values are not available in both timeframes. | string | POSITIVE NEUTRAL NEGATIVE | 
PercentileVariation
| Field | Description | Type | Examples | 
|---|---|---|---|
| *request | Requested percentile expressed in the range (0, 1), e.g. 0.5 (the median). | decimal | 0.5 | 
| *response | Resulting variation value of the requestpercentile. | Variation | 
Paging
| Field | Description | Type | 
|---|---|---|
| last | A relative URI to the last page. | string | 
| first | A relative URI to the first page. | string | 
| prev | A relative URI to the previous page. | string | 
| next | A relative URI to the next page. | string | 
| current | A relative URI to the current page. | string | 
| pages | A set of relative URIs calculated around the current page. | Page | 
| elements | All indexes shown on the current page. | array[int] | 
| total | The number of all elements that API can retrieve. | int | 
| size | The selected page size. | int | 
Page
| Field | Description | Type | 
|---|---|---|
| number | Number of the page. | int | 
| uri | URI of the page. | string | 
Example
{
    "results": {
        "actual": {
            "timeframe": {
                "from": "2021-01-01",
                "to": "2021-07-01"
            },
            "value": [
                {
                    "group": "1",
                    "average": 76.56,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 62.373135
                        }
                    ],
                    "poi": {
                        "partition": 3.91,
                        "count": 25
                    }
                },
                {
                    "group": "2",
                    "average": 116.94,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 78.117676
                        }
                    ],
                    "poi": {
                        "partition": 10.17,
                        "count": 65
                    }
                },
                {
                    "group": "3",
                    "average": 114.9,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 86.35156
                        }
                    ],
                    "poi": {
                        "partition": 42.25,
                        "count": 270
                    }
                },
                {
                    "group": "4",
                    "average": 185.51,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 151.28252
                        }
                    ],
                    "poi": {
                        "partition": 38.65,
                        "count": 247
                    }
                },
                {
                    "group": "5",
                    "average": 795.13,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 516.3026
                        }
                    ],
                    "poi": {
                        "partition": 5.01,
                        "count": 32
                    }
                }
            ]
        },
        "comparison": {
            "timeframe": {
                "from": "2020-07-01",
                "to": "2021-01-01"
            },
            "value": [
                {
                    "group": "1",
                    "average": 62.28,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 59.63671
                        }
                    ],
                    "poi": {
                        "partition": 5.62,
                        "count": 19
                    }
                },
                {
                    "group": "2",
                    "average": 93.13,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 71.88888
                        }
                    ],
                    "poi": {
                        "partition": 9.17,
                        "count": 31
                    }
                },
                {
                    "group": "3",
                    "average": 99.65,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 82.37627
                        }
                    ],
                    "poi": {
                        "partition": 33.73,
                        "count": 114
                    }
                },
                {
                    "group": "4",
                    "average": 180.21,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 142.93431
                        }
                    ],
                    "poi": {
                        "partition": 43.49,
                        "count": 147
                    }
                },
                {
                    "group": "5",
                    "average": 824.08,
                    "percentiles": [
                        {
                            "request": 0.5,
                            "response": 484.42688
                        }
                    ],
                    "poi": {
                        "partition": 7.99,
                        "count": 27
                    }
                }
            ]
        },
        "variation": [
            {
                "group": "1",
                "average": {
                    "value": 14.279999,
                    "variation": "POSITIVE"
                },
                "percentiles": [
                    {
                        "request": 0.5,
                        "response": {
                            "value": 2.74,
                            "variation": "POSITIVE"
                        }
                    }
                ],
                "poi": {
                    "partition": {
                        "value": -1.71,
                        "variation": "NEGATIVE"
                    },
                    "count": {
                        "value": 6,
                        "variation": "POSITIVE"
                    }
                }
            },
            {
                "group": "2",
                "average": {
                    "value": 23.810005,
                    "variation": "POSITIVE"
                },
                "percentiles": [
                    {
                        "request": 0.5,
                        "response": {
                            "value": 6.23,
                            "variation": "POSITIVE"
                        }
                    }
                ],
                "poi": {
                    "partition": {
                        "value": 1.0,
                        "variation": "POSITIVE"
                    },
                    "count": {
                        "value": 34,
                        "variation": "POSITIVE"
                    }
                }
            },
            {
                "group": "3",
                "average": {
                    "value": 15.25,
                    "variation": "POSITIVE"
                },
                "percentiles": [
                    {
                        "request": 0.5,
                        "response": {
                            "value": 3.98,
                            "variation": "POSITIVE"
                        }
                    }
                ],
                "poi": {
                    "partition": {
                        "value": 8.52,
                        "variation": "POSITIVE"
                    },
                    "count": {
                        "value": 156,
                        "variation": "POSITIVE"
                    }
                }
            },
            {
                "group": "4",
                "average": {
                    "value": 5.299988,
                    "variation": "POSITIVE"
                },
                "percentiles": [
                    {
                        "request": 0.5,
                        "response": {
                            "value": 8.35,
                            "variation": "POSITIVE"
                        }
                    }
                ],
                "poi": {
                    "partition": {
                        "value": -4.84,
                        "variation": "NEGATIVE"
                    },
                    "count": {
                        "value": 100,
                        "variation": "POSITIVE"
                    }
                }
            },
            {
                "group": "5",
                "average": {
                    "value": -28.950012,
                    "variation": "NEGATIVE"
                },
                "percentiles": [
                    {
                        "request": 0.5,
                        "response": {
                            "value": 31.88,
                            "variation": "POSITIVE"
                        }
                    }
                ],
                "poi": {
                    "partition": {
                        "value": -2.98,
                        "variation": "NEGATIVE"
                    },
                    "count": {
                        "value": 5,
                        "variation": "POSITIVE"
                    }
                }
            }
        ]
    },
    "paging": {
        "last": "/rates/overall/grouped/compare?page=1&page_size=25&geometry_id=379c730942e570d586a5520770c0a65d&compare_from=2020-07-01&from=2021-01-01&group_type=poi_class&to=2021-07-01&compare_to=2021-01-01",
        "first": "/rates/overall/grouped/compare?page=1&page_size=25&geometry_id=379c730942e570d586a5520770c0a65d&compare_from=2020-07-01&from=2021-01-01&group_type=poi_class&to=2021-07-01&compare_to=2021-01-01",
        "prev": null,
        "next": null,
        "current": "/rates/overall/grouped/compare?page=1&page_size=25&geometry_id=379c730942e570d586a5520770c0a65d&compare_from=2020-07-01&from=2021-01-01&group_type=poi_class&to=2021-07-01&compare_to=2021-01-01",
        "pages": [
            {
                "number": 1,
                "uri": "/rates/overall/grouped/compare?page=1&page_size=25&geometry_id=379c730942e570d586a5520770c0a65d&compare_from=2020-07-01&from=2021-01-01&group_type=poi_class&to=2021-07-01&compare_to=2021-01-01"
            }
        ],
        "total": 5,
        "size": 25,
        "elements": [
            1,
            2,
            3,
            4,
            5
        ]
    }
}