API Specification
Bus Search API
Search available buses between two cities
Endpoint
POST
/api/b2b/bus/search.php
This API returns available buses between selected origin and destination cities for a given journey date.
API Key Authentication
Authenticate requests via HTTP Header or Request ParameterEnjoy Holiday Hub APIs authenticate requests using your unique secret API Key. You can provide your key in either of the following standard formats:
Method 1: Header (Recommended)
Send key in standard HTTP header:
X-API-Key: demo_123456789
Method 2: Body / Query
Send key in JSON payload or query param:
"api_key": "demo_123456789"
Demo Sandbox Key:
Get your production key in Agent Portal
demo_123456789
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
OriginId | integer | Required | Source city ID |
DestinationId | integer | Required | Destination city ID |
DateOfJourney | date | Required | Journey date (YYYY-MM-DD) |
Request Example
JSON Response
{
"api_key": "YOUR_API_KEY",
"OriginId": 8463,
"DestinationId": 9573,
"DateOfJourney": "2026-05-10"
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/bus/search.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"OriginId": 8463,
"DestinationId": 9573,
"DateOfJourney": "2026-05-10",
"api_key": "demo_123456789"
}'
Response Example
JSON Response
{
"status": true,
"data": [
{
"search_token_id": "SEARCH_TOKEN_HERE",
"result_index": 1,
"bus_name": "Deluxe Travels",
"bus_type": "AC Sleeper",
"departure_time": "22:00",
"arrival_time": "06:00",
"duration": "8h",
"available_seats": 12,
"price": 1200
}
]
}
Response (Error)
ERROR / NOTICE
No buses found for selected route
JSON Response
{
"status": false,
"message": "No buses found for selected route"
}
Important Notes
- 🗓 Date format must be YYYY-MM-DD
- 🔢 Use valid OriginId and DestinationId
- 🔁 Results may vary based on availability and pricing
- 📌 Use SearchTokenId and result_index for seat layout, boarding point, block, booking, and cancellation APIs