Content API Documentation

The content API is implemented as an HTTP REST service and uses tokens for authentication.

The base URL for all requests is https://api.hotelwifitest.com/content/v1/.

Authentication

Every HTTP request should contain an Authorization header with the word Token, followed by a space and a token string.

HTTP example

GET /content/v1/hotels/?page_size=10 HTTP/1.1
Host: api.hotelwifitest.com
Accept: application/json
Authorization: Token YXSmIlNLA2qyk6NXUTXYsCanG9DFq78zi7NjYmD

CURL example

curl -H "Authorization: Token YXSmIlNLA2qyk6NXUTXYsCanG9DFq78zi7NjYmD" https://api.hotelwifitest.com/content/v1/hotels/?page_size=10

Obtaining access token

You should have received your access token by email after your application for API access was approved. If you have not received the email or if you need a new access token, please contact us.

API endpoints

/hotels/

Returns a list of tested hotels with WiFi quality information in bulk. The information should be stored in your own database and presented to users when needed. Remember to refresh your database by calling this method at least once a week.

This main use case is to call this method without any parameters for the first page and then to use the page number to iterate the list. You can request data only about specific hotels by adding a list of hotel IDs to the query parameters.

Query Parameters:
 
  • page – (optional) page number, starting from 1
  • page_size – (optional) number of results per page, default 1000, max 1000
  • ids – (optional) comma-separated list of hotelwifitest.com’s hotel IDs
  • ean_ids – (optional) comma-separated list of Expedia Affiliate Network hotel IDs
  • tripadvisor_ids – (optional) comma-separated list of Tripadvisor hotel IDs
Request Headers:
 
Response JSON Object:
 
  • count (int) – total number of hotels
  • next (string) – URL of the next page (if applicable)
  • previous (string) – URL of the previous page (if applicable)
  • results (array) – hotel WiFi quality records

Every element in the results array is a JSON object containing information about a hotel.

Response JSON Array of Objects (results):
 
  • id (int) – hotelwfiwitest.com hotel ID
  • ean_id (int) – Expedia Affiliate Network hotel ID
  • tripadvisor_id (int) – TripAdvisor hotel ID
  • name (string) – hotel name
  • url (string) – link to hotel’s page on http://www.hotelwifitest.com
  • full_address (string) – hotel’s full address
  • expected_speed (float) – indicates the speed in Mbps that a user would likely get at a randomly chosen time of day.
  • percentile_rank (float) – a percentile ranking that shows how this hotel compares with other hotels worldwide. It takes into account all key WiFi characteristics, such as download speed, upload speed, and latency along with confidence. This is the recommended value for the initial sorting and filtering.
  • confidence (float) – a percentage value that shows how thoroughly the WiFi has been tested at the hotel. The confidence value depends on several factors, including the number of speed tests taken, the number and rating of users who took them, how recently the tests occurred, and the diversity of tests in terms of the time of day and day of the week.

HTTP example

GET /content/v1/hotels/?page_size=2 HTTP/1.1
Host: api.hotelwifitest.com
Accept: application/json
Authorization: Token YXSmIlNLA2qyk6NXUTXYsCanG9DFq78zi7NjYmD

curl example

curl -H "Authorization: Token YXSmIlNLA2qyk6NXUTXYsCanG9DFq78zi7NjYmD" https://api.hotelwifitest.com/content/v1/hotels/?page_size=2

Response

{
  "count": 13493,
  "next": "http://api.hotelwifitest.com/content/v1/hotels/?page=2",
  "previous": null,
  "results": [
    {
      "id": 83510,
      "ean_id": 239056,
      "tripadvisor_id": 502385,
      "name": "Yasmin Bodrum Resort",
      "url": "/hotels/tr/bodrum/yasmin-bodrum-resort-all-inclusive/",
      "full_address": "Kadikalesi Mevkii Turgutreis, Bodrum 48800, Turkey",
      "expected_speed": 1.57154592426138,
      "percentile_rank": 36.309077269,
      "confidence": 15.5198397360193,
    },
    {
      "id": 40235,
      "ean_id": 121592,
      "tripadvisor_id": 86186,
      "name": "Courtyard St. Petersburg Clearwater",
      "url": "/hotels/us/clearwater/courtyard-by-marriott-clearwater/",
      "full_address": "3131 Executive Dr, Clearwater, FL 33762, United States",
      "expected_speed": 1.57155381050265,
      "percentile_rank": 36.316579144,
      "confidence": 4.28571428571428,
    }
  ]
}

© 2013-2016 Hotel WiFi Test Inc.