Query Amenities

Learn how to query amenities from the API

In addition to price information, amenity information is available in the API. Here is an example that queries all coffee shops in the city of Seattle. Note that we are starting with the desired geography (Seattle city), and aggregating the total number of coffee shops:

query SEATTLE_COFFEE_SHOPS {
  CITY(where: {CITY_NAME: {_eq: "Seattle"}}) {
    CITY_NAME
    MSA_NAME
    amenities_aggregate(where: {AMENITY_CATEGORY_TYPE: {_eq: "cafe"}}) {
      aggregate {
        sum {
          NUM_AMENITIES
        }
      }
      nodes {
        AMENITY_CATEGORY_TYPE
      }
    }
  }
}

Data output:

{
  "data": {
    "CITY": [
      {
        "CITY_NAME": "Seattle",
        "MSA_NAME": "Seattle-Tacoma-Bellevue, WA",
        "amenities_aggregate": {
          "aggregate": {
            "sum": {
              "NUM_AMENITIES": 650
            }
          },
          "nodes": [
            {
              "AMENITY_CATEGORY_TYPE": "cafe"
            }
          ]
        }
      }
    ]
  }
}

What’s Next

You can view our amenities objects for a list of all amenity variables available in the API.