Retrieve all stores in a city from single brand using search with multiple attributes. The below query searches for all of the Dunkin' Donuts stores in the city of Boston.

query {
  search(first: 5 filter: { 
    brand: "Dunkin' Donuts", 
    address: { 
        city: "Boston"
        region: "MA" 
    } 
  }) {
    safegraph_core {
      location_name
      street_address
      city
      region
      brands
      open_hours
      opened_on
      closed_on
    }
  }
}
curl --location --request POST 'https://api.safegraph.com/v1/graphql' \
--header 'apikey: {your-api-key}' \
--header 'content-type: application/json' \
--data-raw '{"query":"query {\n  search(first: 5 filter: { \n    brand: \"Dunkin'\'' Donuts\", \n    address: { \n        city: \"Boston\"\n        region: \"MA\" \n    } \n  }) {\n    safegraph_core {\n      location_name\n      street_address\n      city\n      region\n      brands\n      open_hours\n      opened_on\n      closed_on\n    }\n  }\n}","variables":{}}'
# pip install safegraphQL
import safegraphql.client as sgql

sgql_client = sgql.HTTP_Client(apikey = 'your-api-key')

brand = "Dunkin' Donuts"
city = 'Boston'
region = 'MA'
cols = [
    'location_name',
    'street_address',
    'city',
    'region',
    'brands',
    'open_hours',
    'opened_on',
    'closed_on'
]

sgql_client.search(product = 'core', brand = brand, city = city, region = region, columns = cols, max_results = 5)
{
  "data": {
    "search": [
      {
        "safegraph_core": {
          "location_name": "Dunkin'",
          "street_address": "400 Fenwayemmanuel College",
          "city": "Boston",
          "region": "MA",
          "brands": [
            {
              "brand_id": "SG_BRAND_9b4045db0fbb461cf9ed78916d9b16b4",
              "brand_name": "dunkin donuts"
            }
          ],
          "open_hours": "{ \"Mon\": [[\"7:00\", \"15:00\"]], \"Tue\": [[\"7:00\", \"15:00\"]], \"Wed\": [[\"7:00\", \"15:00\"]], \"Thu\": [[\"7:00\", \"15:00\"]], \"Fri\": [[\"7:00\", \"15:00\"]], \"Sat\": [], \"Sun\": [] }",
          "opened_on": null,
          "closed_on": null
        }
      },
      {
        "safegraph_core": {
          "location_name": "Dunkin'",
          "street_address": "296 Cambridge St",
          "city": "Boston",
          "region": "MA",
          "brands": [
            {
              "brand_id": "SG_BRAND_9b4045db0fbb461cf9ed78916d9b16b4",
              "brand_name": "dunkin donuts"
            }
          ],
          "open_hours": "{ \"Mon\": [[\"6:00\", \"19:00\"]], \"Tue\": [[\"6:00\", \"19:00\"]], \"Wed\": [[\"6:00\", \"19:00\"]], \"Thu\": [[\"6:00\", \"19:00\"]], \"Fri\": [[\"6:00\", \"19:00\"]], \"Sat\": [[\"6:00\", \"19:00\"]], \"Sun\": [[\"6:00\", \"19:00\"]] }",
          "opened_on": "2020-03-18",
          "closed_on": null
        }
      },
      {
        "safegraph_core": {
          "location_name": "Dunkin'",
          "street_address": "145 Dartmouth Stbackbay Station",
          "city": "Boston",
          "region": "MA",
          "brands": [
            {
              "brand_id": "SG_BRAND_9b4045db0fbb461cf9ed78916d9b16b4",
              "brand_name": "dunkin donuts"
            }
          ],
          "open_hours": "{ \"Mon\": [[\"6:00\", \"13:00\"]], \"Tue\": [[\"6:00\", \"13:00\"]], \"Wed\": [[\"6:00\", \"13:00\"]], \"Thu\": [[\"6:00\", \"13:00\"]], \"Fri\": [[\"6:00\", \"13:00\"]], \"Sat\": [], \"Sun\": [] }",
          "opened_on": null,
          "closed_on": null
        }
      },
      {
        "safegraph_core": {
          "location_name": "Dunkin'",
          "street_address": "4 Yawkey Wayfenway Park Premium Seating",
          "city": "Boston",
          "region": "MA",
          "brands": [
            {
              "brand_id": "SG_BRAND_9b4045db0fbb461cf9ed78916d9b16b4",
              "brand_name": "dunkin donuts"
            }
          ],
          "open_hours": null,
          "opened_on": "2020-03-23",
          "closed_on": "2021-01-18"
        }
      },
      {
        "safegraph_core": {
          "location_name": "Dunkin'",
          "street_address": "8 Park Plzcity Place",
          "city": "Boston",
          "region": "MA",
          "brands": [
            {
              "brand_id": "SG_BRAND_9b4045db0fbb461cf9ed78916d9b16b4",
              "brand_name": "dunkin donuts"
            }
          ],
          "open_hours": "{ \"Mon\": [[\"6:00\", \"16:00\"]], \"Tue\": [[\"6:00\", \"16:00\"]], \"Wed\": [[\"6:00\", \"16:00\"]], \"Thu\": [[\"6:00\", \"16:00\"]], \"Fri\": [[\"6:00\", \"16:00\"]], \"Sat\": [[\"7:00\", \"15:00\"]], \"Sun\": [[\"7:00\", \"15:00\"]] }",
          "opened_on": null,
          "closed_on": null
        }
      }
    ]
  },
  "extensions": {
    "row_count": 5,
    "version_date": "1627739802__2021_07"
  }
}