Authentication
Getting an API Key
- Sign up or log in at hub.stay22.com
- Navigate to the API settings:
- New Hub: Settings → API — enter a token name and click Create
- Old Hub: Settings → scroll to HUB DATA REPORTING API → enter a token name and click Generate a new token
Using Your API Key
Pass your API key as the key query parameter:
bash
curl "{{API_BASE_URL}}/v1/accommodations?key=your_api_key_here&provider=booking&address=Paris"You can also pass your API key in the X-API-KEY header:
bash
curl -H "X-API-KEY: your_api_key_here" \
"{{API_BASE_URL}}/v1/accommodations?provider=booking&address=Paris"Demo Mode
You can use the API without a key for quick testing:
bash
curl "{{API_BASE_URL}}/v1/accommodations?provider=booking&address=Paris"Try this request in your browser ↗
Demo mode is limited to 5 requests per minute per IP address. Get an API key for 100 req/min.
Invalid API Key
Should an API key be missing or invalid, you will be presented with a 401 error as prescribed below:
json
{
"statusCode": 401,
"error": "Unauthorized",
"code": "INVALID_API_KEY",
"message": "Invalid API key. Get your API key at hub.stay22.com",
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}See the API Reference for all error codes.