AA Rated Trips Ratings and Establishment API
Main Information
This API allows the authorised user to access establishment data from the ratedtrips.com website.
Business Case
Allow external agencies the ability to download the ratings data for all schemes from a particular location when needed. The primary use cases will be search by date and location e.g. new establishments from last 7 days in London.
API Flow
- Request made to API with query parameters.
- Relevant Establishments are generated
- JSON data of the establishments that meet the query will be returned.
- User can then decode the JSON and use as required
Request/Response
| API Name | Endpoint URL | Verb | Description |
|---|---|---|---|
| Ratings Api | https://www.ratedtrips.com/api/v1/RatingsByDate |
GET | Depending on the query parameters placed at the end of this URL we can retrieve establishment data that meet many different specific criteria. |
Headers
Headers of the request
Content-Type: application/json
Example Request
Request sample (PHP (cURL)):
<?php
$api_key = '<your-api-key>';
$query_params = [
"apikey" => $api_key,
"city" => "london",
"created_since" => "01-02-2024"
];
$url = "http://www.ratedtrips.com/api/v1/RatingsByDate?" . http_build_query($query_params);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'cURL Error: ' . curl_error($curl);
} else {
$data = json_decode($response, true);
echo 'Response: ' . json_encode($data, JSON_PRETTY_PRINT);
}
curl_close($curl);
?>Response Example
[
{
"name": "Chelsea Football Club Stadium Tour & Museum",
"accommodation_type": "Things to do",
"award": "",
"designator": "Attraction",
"designator_id": "ATT",
"aa_id": "",
"full_address": "Stamford Bridge Fulham Road LONDON Greater London SW6 1HS",
"nid": "359421",
"TXGBid": "",
"ve_id": "900173",
"ve_rating": "2",
"link": "http:\/\/staging.ratedtrips.com\/establishments\/chelsea-football-club-stadium-tour-museum",
"aa_rating": "",
"country": "England",
"county": "Greater London",
"company": "",
"region": "",
"city": "London",
"Awards": "",
"postal_code": "SW6 1HS",
"field_is_aa": "Off",
"field_is_ve": "On",
"created": "4 months 3 weeks ago",
"revision_timestamp": "4 months 3 weeks 1 day ago"
},
{
"name": "HM Tower of London",
"accommodation_type": "Things to do",
"award": "GOLD",
"designator": "Attraction",
"designator_id": "ATT",
"aa_id": "",
"full_address": "LONDON Greater London EC3N 4AB",
"nid": "359471",
"TXGBid": "",
"ve_id": "900419",
"ve_rating": "2",
"link": "http:\/\/staging.ratedtrips.com\/establishments\/hm-tower-of-london",
"aa_rating": "",
"country": "England",
"county": "Greater London",
"company": "",
"region": "",
"city": "London",
"Awards": "{\"GOLD\":\"https:\\\/\\\/ratedtrips.com\\\/sites\\\/all\\\/themes\\\/rated_trips\\\/awards\\\/VisitEngland Gold Accolade.png\"\"Gold (Activity) accolade\":\"https:\\\/\\\/ratedtrips.com\\\/themes\\\/custom\\\/rated_trips\\\/awards\\\/VisitEngland Gold Accolade.png\"\"Visit England Attraction\":\"https:\\\/\\\/ratedtrips.com\\\/themes\\\/custom\\\/rated_trips\\\/awards\\\/ve_attraction.png\"}",
"postal_code": "EC3N 4AB",
"field_is_aa": "Off",
"field_is_ve": "On",
"created": "4 months 1 week ago",
"revision_timestamp": "4 months 1 week ago"
}
]
Example Request 2
Request sample via URL:
www.ratedtrips.com/api/v1/RatingsByDate?apikey={your-api-key}&aa=1&ve=1
In the above example we start with the main url for the api:
www.ratedtrips.com/api/v1/RatingsByDate
We then add a question mark for the query which should start with the api key (do not include the curly brackets):
apikey={your-api-key}
After this we can add any of the below 'input parameters' which each seperated by an '&'.
You can add as many parameters as you require, they are all compatibale with each other.
Input Parameters
| № | Parameter | Data Type | Mandatory | Description | Example |
|---|---|---|---|---|---|
| 1 | city | varchar string | No | The city you would like to search | London |
| 2 | aa | Int (bool) | No | An establishment on the AA scheme (1 or 0) | 1 |
| 3 | ve | Int (bool) | No | An establishment on the VE scheme (1 or 0) | 0 |
| 4 | des-id | 3 letter varchar string | No | Returns the establishment type – See document listing the des-id to establishment type | HOT |
| 5 | created_since | Date (dd-mm-yyyy) | No | Shows establishments that have been added to the ratedtrips.com website since a given date | 01-01-2024 |
| 6 | modified_after | Date (dd-mm-yyyy) | No | Shows establishments that have been modified since a certain date | 01-02-2024 |
| 7 | aa_id | Numerical string | No | Search for a specific AA establishment via their ID | 123456 |
| 8 | ve_id | Numerical string | No | Search for a specific VE establishment via their ID | 123456 |
| 9 | rating_suspended | Boolean | No | Returns true/false depending on rating suspended status | 1 |
| 10 | awaiting_assessment | Boolean | No | Returns true/false depending on awaiting assessment status | 0 |
| 11 | rosettes_suspended | Boolean | No | Returns true/false depending on rosettes suspended status | 1 |
| 12 | quality_assessed_aa | Boolean | No | Returns true/false depending on quality assessed status for AA | 0 |
| 13 | quality_assessed_ve | Boolean | No | Returns true/false depending on quality assessed status for VE | 1 |
Response Codes
| Response Code | Message | Meaning |
|---|---|---|
| 200 - OK | Success | Success |
| 400 – Bad Request | API key is missing | API key not found in header |
| 403 – Authentication error | Access denied. Invalid API key | Incorrect key |
| 404 – Not Found | Incorrect URL or API is down | |
| 503 – Service Unavailable | The resource is currently busy i.e. already being processed. | |
| 500 – Internal Server Error | All other exceptions |