WayFy’s AI API bridges natural language and map interactions. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jhonyes04/new-wayfy/llms.txt
Use this file to discover all available pages before exploring further.
mapgpt endpoint accepts plain-language prompts from the map search bar — such as “find wheelchair-friendly cafés near the Prado” — and returns structured data that the WayFy frontend uses to pan the map, apply category filters, and set accessibility filters in a single step. Geocoding endpoints resolve text queries into geographic coordinates using Photon and Nominatim.
The
mapgpt endpoint is powered by llama-3.3-70b-versatile via the Groq API and requires a valid GROQ_API_KEY environment variable set on the server. Geocoding endpoints call external public services — no API key is required for those.All AI endpoints are rate-limited. Exceeding the limit returns
429 Too Many Requests. Rate limits are: mapgpt — 20 requests/minute; geocoding endpoints — 30 requests/minute each.Map Assistant
POST /api/ai/mapgpt
Interprets a free-text user prompt and returns structured map directives. The LLM extracts intent from the prompt and responds with a JSON object that WayFy’s frontend consumes to update the map state — panning to a location, filtering by category, and applying accessibility constraints simultaneously. Authentication: NoneRate Limit: 20 requests per minute
Request
The user’s natural-language search query (e.g.
"restaurants with accessible parking near Retiro Park, Madrid"). Returns 400 Bad Request with {"msg": "Prompt vacío"} if the prompt is missing or blank.Response
The LLM returns a JSON object with the following fields. The exact shape depends on the model’s output.A specific point of interest name extracted from the prompt, if any (e.g.
"Retiro Park"). null if no specific POI was detected.A street address or neighbourhood extracted from the prompt.
null if not detected.A city, region, or general place name extracted from the prompt (e.g.
"Madrid"). null if not detected.Array of WayFy category strings to filter by. Valid values:
alojamiento, gastronomia, transporte, salud, cultura_turismo, recreacion, deporte, gobierno, baños, dinero, tiendas. Empty array if no categories apply.Array of wheelchair accessibility filter values the frontend should activate. Valid values:
yes, limited, no. Empty array if no accessibility filter is implied.A natural-language response to display to the user confirming what WayFy understood and will do.
Error responses
"Prompt vacío" — returned with 400 when the prompt is empty or whitespace-only.Example
- Cafés with limited access
- Multi-category search
- No accessibility filter
Prompt:
"coffee shops that have some accessibility near the Gothic Quarter Barcelona"Geocoding
GET /api/ai/geocode?q=<query>
Resolves a text query to geographic coordinates using Nominatim. Returns the best matching feature — including its center point and geometry — ornull if no match is found. Returns 400 if the query is empty.
Authentication: NoneRate Limit: 30 requests per minute
Request
The search query to geocode (e.g.
"Prado Museum, Madrid"). Returns 400 if blank.Response
The best-matching geocoded feature, or
null if no result was found.Example
GET /api/ai/geocode-poi?q=<query>
Resolves a POI query to geographic coordinates with automatic dual-source fallback. The endpoint first queries Photon (optimised for POI search) and falls back to Nominatim if Photon returns no results. For long queries, progressively shorter sub-strings are tried through both services before giving up. Returns{"feature": null} (never an error) if no result is found even after all attempts.
Authentication: NoneRate Limit: 30 requests per minute
Use
geocode-poi for named place lookups (e.g. a specific restaurant or landmark). Use geocode for address or area lookups (e.g. resolving a street address or city name). Both endpoints return the same feature shape.Request
The POI name or query to geocode (e.g.
"Sagrada Família"). An empty query returns {"feature": null} with 200 rather than an error.Response
The best-matching geocoded feature, or
null if neither Photon nor Nominatim returned a result. Same shape as the geocode endpoint.