Website Widget
The Website Widget lets you embed dynamic fact sheet data from Ananas GDS directly into your own website — hotel website, tour operator portal, or booking engine — without building a full API integration from scratch.
How It Works
The widget is a JavaScript snippet that fetches your published fact sheet data and renders it into a target <div> on your page. It uses the same token system as the API, but additionally validates that the request originates from your whitelisted domain.
Getting Your Embed Code
- Go to Developer Tools → Website Widget in the app.
- Select the property you want to embed.
- Enter the domain where the widget will be hosted (e.g.
yourhotel.com). This domain is whitelisted for that specific widget token. - Copy the generated embed snippet.
Embed Snippet Example
<div id="ananas-facts-widget" data-property="abc123"></div>
<script src="https://app.hotelfacts.net/widget/v1/embed.js"
data-token="your-widget-token"
data-target="#ananas-facts-widget"
data-lang="en">
</script>
Widget Parameters
Attribute |
Required |
Description |
|---|---|---|
data-token |
Required | Your widget-specific token (different from the partnership API token). |
data-target |
Required | CSS selector for the container element. |
data-property |
Required | Property ID to display. |
data-lang |
Optional | Language code (e.g. en, de, tr). Defaults to en. |
data-sections |
Optional | Comma-separated list of sections to display. Default: all. Options: main_info, facilities, rooms, food, entertainment, sports |
data-theme |
Optional | light (default) or dark |
Note: Widget tokens are domain-locked. A token generated for yourhotel.com will not work on differentdomain.com. Adding your website in Company Details does not automatically whitelist it for the widget — you must generate a dedicated widget token with the specific domain.
Error Codes
HTTP Status |
Error |
Cause |
|---|---|---|
400 |
Bad Request | Malformed request, invalid date format, or missing required parameter. |
401 |
Unauthorized | Token missing, invalid, or revoked. |
403 |
Forbidden | Token valid but contract does not grant access to the requested data type or property. |
404 |
Not Found | Property ID not found, or no published data available for the requested property. |
429 |
Too Many Requests | Rate limit exceeded. Reduce request frequency. |
500 |
Server Error | Internal error. Retry after a short delay. If the issue persists, contact support. |
