Skip to main content

Documentation 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.

WayFy’s Utils API provides two lightweight enrichment endpoints used by the frontend to enhance place cards and trip share previews. The OG image endpoint extracts social preview images from any URL, enabling rich link previews when users share trips. The Google Photo endpoint fetches a street-level or venue photo from the Google Places API v1 for any named location, giving WayFy place cards a visual context when no community photo is available.
Both endpoints are rate-limited to 60 requests per minute. Exceeding this limit returns 429 Too Many Requests. The Google photo endpoint requires the GOOGLE_PLACES_KEY environment variable to be configured on the server.

Open Graph Images

GET /api/utils/og-image?url=<url>

Fetches the Open Graph or Twitter card image from a given URL by parsing its <meta> tags. Used by WayFy to generate rich trip share previews when users copy a trip link to social media or messaging apps. Authentication: None
Rate Limit: 60 requests per minute
This endpoint returns {"image": null} (rather than an error body) when the target page does not have OG/Twitter image meta tags, is unreachable, or returns a non-HTML response. Build your UI to gracefully handle the null case with a fallback image.

Request

url
string
required
The fully-qualified URL to inspect for OG/Twitter image meta tags. Must begin with http:// or https://. Returns 400 Bad Request with {"image": null} if this parameter is missing or does not start with a valid HTTP scheme.

Response

image
string
The absolute URL of the OG or Twitter card image found in the page’s meta tags, or null if no image meta tag was found or the request failed.
Passing a URL that does not begin with http:// or https:// returns 400 Bad Request with body {"image": null}. Always validate the URL on the client before calling this endpoint.

Example

curl "http://localhost:3001/api/utils/og-image?url=https%3A%2F%2Fwayfy.app%2Ftrips%2F15"
{
  "image": "https://wayfy.app/images/trips/lisbon_cover_social.jpg"
}
No OG image found (or fetch failed):
{
  "image": null
}
Bad request — missing or invalid URL (400):
{
  "image": null
}

Google Places Photos

GET /api/utils/google-photo?name=<name>&lat=<lat>&lon=<lon>

Fetches a representative photo URI for a named place near a given coordinate using the Google Places API v1 (places.googleapis.com/v1). WayFy uses this endpoint to populate place cards with a venue photo when no community-uploaded photo is available for the location. Authentication: None
Rate Limit: 60 requests per minute
This endpoint requires the GOOGLE_PLACES_KEY environment variable to be set on the WayFy server. If the key is not configured, the endpoint returns 503 Service Unavailable with body {"photo": null}. Ensure the key is present in production before enabling photo-enriched place cards.

Request

name
string
required
The name of the place to look up (e.g. "Café Inclusivo"). Used in the Google Places text search. Returns 400 with {"photo": null} if missing.
lat
number
required
Latitude coordinate near which to search. Used to bias results toward the correct location when the place name is ambiguous. Returns 400 with {"photo": null} if missing.
lon
number
required
Longitude coordinate near which to search. Returns 400 with {"photo": null} if missing.

Response

photo
string
The Google Places photo URI for the matched venue, or null if no photo is available, the place could not be found, or an error occurred.

Example

curl "http://localhost:3001/api/utils/google-photo?name=Caf%C3%A9+Inclusivo&lat=40.41650&lon=-3.70325"
{
  "photo": "https://places.googleapis.com/v1/places/ChIJ.../photos/AXCi.../media?maxHeightPx=800&key=..."
}
No photo found:
{
  "photo": null
}
Missing required parameters (400):
{
  "photo": null
}
Google Places API key not configured (503):
{
  "photo": null
}

Build docs developers (and LLMs) love