Skip to main content

Elevate Your App's Experience with Google Places API on Hypi's Low-Code Platform

Explore Hypi's serverless functions

written by:
Courtney Robinson

If you're looking to supercharge your application with location-based insights and information, the Google Places API is your go-to solution. This robust function opens up a world of possibilities, allowing you to seamlessly integrate Google's wealth of location data into your Hypi GraphQL queries and mutations.

Usage Made Simple

Integrating the Google Places API is as straightforward as adding a function to your Hypi Query or Mutation types under the schema. Whether you're creating new types or modifying existing ones, the flexibility of this integration ensures a smooth implementation.

type Query {
findGooglePlaces(action: String, radius: Int!, lat: Float!, long: Float!): Json @fn(name: "google-places", version: "v1.1", src: hypi, env: ["GOOGLE_PLACES_KEY"])
}

Feel free to customize the function name (findGooglePlaces in this example) to suit your preferences. The return type is Json, but you have the option to create a custom type matching the structure returned by the function.

Environmental Essentials

To get started, you'll need to set up a crucial environment variable: GOOGLE_PLACES_KEY. This key acts as your golden ticket to access the Google Places API. Ensure you create this environment variable in your Hypi app, providing the key's value for each instance utilizing the function.

Action-Packed Arguments

The power of the Google Places API lies in its versatility, thanks to a range of supported actions and their associated arguments. Let's dive into the key actions:

  1. Details Action

  2. Photo Action

    • photoreference: Reference obtained from the search-nearby action
    • maxheight and maxwidth: Integer values between 1 and 1600
    • Photo Documentation
  3. Search Nearby Next Page Action

  4. Search Nearby Action

    • lat: The latitude
    • long: The longitude
    • radius: Meters from lat/long (max is 50K)
    • keyword: Search keyword
    • opennow: Only return places that are open now
    • rankby: Supported values: PROMINENCE or DISTANCE
    • minprice and maxprice: Supported values: FREE, INEXPENSIVE,MODERATE,EXPENSIVE,VERY_EXPENSIVE
    • type: Supported values (examples):
      • RESTAURANT
      • GROCERY_OR_SUPERMARKET
      • PHARMACY
      • and many more
    • Search Nearby Documentation

Embrace the power of Google Places API, and elevate your application's location-based capabilities to new heights. Your users will thank you for the enriched experience!

Ready to transform your app with location-based magic? Dive into the Google Places API integration and unlock a new realm of possibilities. Get involved today and redefine user experiences like never before!

See more details on github/fn-google-places

Powered By Hypi.
Loading...
X

Still not convinced? Contact our sales team for a free demo, we’ll get you started

Make it happen! Access scalable platform for your customers needs.

Phone

By registering you agree to the Terms & Conditions