Building a Travel Chatbot
Learn how to integrate the LLM-friendly Trips endpoint to power AI chatbots and conversational travel assistants.
Overview
The /v3/trips/llm endpoint delivers travel requirements in a token-efficient markdown format that's perfect for chatbots. Instead of parsing complex JSON structures, your AI assistant gets natural language responses it can work with immediately.
When to Use This Endpoint
Configure your chatbot to call this API when travelers ask about:
- Visa requirements: "Do I need a visa for Japan?"
- Travel documents: "What passport validity do I need?"
- Entry requirements: "Can I enter with my UK passport?"
- Health requirements: "Do I need vaccinations for Brazil?"
- Connection/Transit rules: "Do I need a visa if I'm connecting through Dubai?"
đź’ˇ Pro Tip
Don't call this API for general travel advice, booking questions, weather info, or hotel recommendations. Reserve it specifically for government travel requirements.
Sample Tool Configuration
Here's a production-tested prompt you can adapt for your chatbot platform (Voiceflow, OpenAI Assistant API, Dialogflow, etc.):
Tool Definition
Tool Name: get_travel_requirements
Tool Description:
Use this tool when the user asks about visa, travel requirements, passport validity,
vaccinations, or entry rules for their trip.
Call this tool when you have:
- The traveler's passport country
- Their destination country
- Travel dates (or approximate timeframe)
The tool returns markdown-formatted requirements. When responding to the user:
- Summarize in conversational language
- Only share what the traveler specifically asked about
- Highlight eVisa or eTA options when available (they're easier and save time at the airport)
- Skip COVID-19 information unless explicitly requested
- Assume leisure travel unless the user mentions business or study
Request Parameters
| Parameter | How to Extract |
|---|
| Passport Country | Ask: "What passport will you be traveling with?" or "What's your nationality?" |
| Origin | Ask: "Where are you traveling from?" (optional but helpful for connection requirements) |
| Destination | Ask: "Where are you heading?" or extract from: "I'm going to Thailand" |
| Travel Date | Ask: "When are you planning to travel?" Use approximate date if not specified |
Example Integration
Scenario: Traveler Needs an ESTA
Traveler: "Do I need a visa for New York? I'm flying from London with a UK passport."
Step 1: Your chatbot extracts information
- Passport: GBR (United Kingdom)
- Origin: LHR (London Heathrow)
- Destination: JFK (New York)
- Travel date: 30 days from today
Step 2: Make API request
curl --location --request POST 'https://requirements-api.joinsherpa.com/v3/trips/llm' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Accept: text/markdown' \
--header 'x-api-key: YOUR_API_KEY' \
--data-raw '{
"data": {
"type": "TRIP",
"attributes": {
"locale": "en-US",
"traveller": {
"passports": ["GBR"]
},
"currency": "USD",
"travelNodes": [
{
"type": "ORIGIN",
"airportCode": "LHR",
"departure": {
"date": "2026-11-15",
"time": "12:59",
"travelMode": "AIR"
}
},
{
"type": "DESTINATION",
"airportCode": "JFK",
"arrival": {
"date": "2026-11-15",
"time": "18:30",
"travelMode": "AIR"
}
}
]
}
}
}'
Step 3: Receive markdown response
# Visa Requirements
### You need an ETA for United States if you have a British passport.
## New York (JFK)
### Electronic Travel Authorization (ESTA) for stays up to 90 days - Mandatory
Travelers need a travel authorization to visit United States of America for Business or Tourism.
The Electronic System for Travel Authorization (ESTA) is an online application that determines
the eligibility of visitors to enter United States. Once the application is approved, travelers
receive their ESTA confirmation electronically.
An ESTA is electronically linked to a passport and valid for 2 years. If travelers receive a
new passport, they must apply for a new ESTA.
**[Apply for ESTA](https://sherpa-widget.joinsherpa.io/applications/products/USA_ESTA?affiliateId=...)**
_Official source: [United States Department of State](https://travel.state.gov/...)_
_Last updated: November 10, 2026 at 3:45 PM UTC_
# Passport and Documents
## New York (JFK)
### Travelers require a passport valid for the duration of stay - Mandatory
Travelers need a valid passport to enter United States. The traveler's passport must remain
valid throughout the traveler's stay in United States. The passport must have at least 1 blank page.
...
Step 4: Your chatbot responds
âś… Good response (focused, conversational, highlights Sherpa's ESTA option):
"You'll need an ESTA to enter the United States. The good news is you can apply online in just a few minutes—it's approved electronically and valid for 2 years. Would you like help applying for your ESTA?"
❌ Bad response (dumps everything):
"You need an ESTA. Your passport must be valid for the duration of stay and have 1 blank page. COVID test is not required. There's also an MPC app for passport control..."
🎯 Key Principle
The API returns comprehensive information, but your chatbot should only share what the traveler asked about. Let them ask follow-up questions if they want more details.
Best Practices for Chatbot Responses
1. Answer Only What's Asked
Traveler: "Do I need a visa for Paris?"
- âś… DO: Only share visa requirements
- ❌ DON'T: Dump passport validity, health requirements, and COVID info
2. Recommend eVisa and eTA Options
When the response shows eVisa or eTA availability, highlight the convenience:
"You can apply for an eVisa online before your trip—it's quick and easy.
This saves time at the airport and you'll arrive ready to go. Would you like help with that?"
Look for Sherpa application links in the response (URLs containing sherpa-widget.joinsherpa.io) and prioritize recommending those options.
3. Skip COVID Information by Default
Unless explicitly asked, omit COVID requirements—most travelers don't need this anymore.
4. Handle Multi-Country Trips
Traveler: "I'm flying from New York to Bangkok with a layover in Tokyo. Do I need any visas?"
Your chatbot should:
- Call the API with Tokyo as a
TRANSIT type travel node
- Get requirements for both the connection and final destination
- Respond clearly: "For your connection in Tokyo, you don't need a transit visa. For Thailand, you can enter visa-free for up to 30 days."
5. Collect Information Conversationally
Instead of asking for everything upfront:
Bot: "I can help with that! What passport will you be traveling with?"
User: "Canadian"
Bot: "Great! And where are you heading?"
User: "Vietnam"
Bot: "When are you planning to travel?"
User: "Next month"
Bot: [Makes API call] "Good news! Canadians can enter Vietnam visa-free..."
Common Challenges and Solutions
Challenge: Too Much Information
Problem: API returns visa, passport, health, and more—but the user only asked about visas.
Solution: Use your LLM to filter the response. Instruct it: "Only share information relevant to the user's question. Save other details for follow-up questions."
Challenge: Complex Multi-Country Trips
Problem: User has connections/layovers and multiple destinations.
Solution: Structure your request with multiple travel nodes. Use TRANSIT type for connections:
{
"travelNodes": [
{
"type": "ORIGIN",
"locationCode": "USA",
"departure": {
"date": "2026-12-15",
"time": "08:00",
"travelMode": "AIR"
}
},
{
"type": "TRANSIT",
"locationCode": "ARE",
"arrival": {
"date": "2026-12-15",
"time": "20:00",
"travelMode": "AIR"
},
"departure": {
"date": "2026-12-16",
"time": "02:00",
"travelMode": "AIR"
}
},
{
"type": "DESTINATION",
"locationCode": "THA",
"arrival": {
"date": "2026-12-16",
"time": "08:00",
"travelMode": "AIR"
}
}
]
}
Challenge: Unknown Travel Dates
Problem: User hasn't decided when they're traveling.
Solution: Use a date 30-60 days in the future as a default. Requirements rarely change that quickly, and it gives you current information.
Challenge: Vague Questions
Problem: "Tell me about traveling to Europe"
Solution: Ask clarifying questions:
"I'd be happy to help! Europe has many countries with different requirements.
Which specific country are you interested in? For example, France, Italy, or Germany?"
Testing Your Integration
Test Cases to Cover
- ESTA required: UK passport holder to USA
- eVisa available: Canadian to India
- No visa required: US to UK
- Connection scenario: Flight with layover/connection in Dubai
- Multi-destination trip: Travel through Southeast Asia with multiple stops
- Vague question: "Do I need anything for my trip?"
Expected Response Quality
Your chatbot should:
- âś… Answer the specific question asked
- âś… Use conversational, friendly language
- âś… Highlight eVisa options when available
- âś… Avoid overwhelming users with information
- âś… Offer to answer follow-up questions
Next Steps
🚀 Ready to Build?
Start with a simple visa checker, test with real queries, and expand from there. Most chatbot integrations take just a few hours to get up and running.