Submit the Placekey of a location and get the location details back. Generate a Placekey of the desired location from Placekey.io or look up the POI (and corresponding Placekey) using the lookup: location_name & address query type. You may request attributes from Safegraph Core, Geometry, or Pattern data sets.

Request Parameters: Placekey

For Placekey lookup, the placekey value is needed as an input argument to retrieve details of a POI.

Parameter

Description

placekey

Generated Placekey of a location

Example

query {
  lookup(placekey: "[email protected]") {
    safegraph_core {
      placekey
      latitude
      longitude
      street_address
      city
      region
      postal_code
      iso_country_code
      parent_placekey
      location_name
      brands {
        brand_id
        brand_name
      }
      top_category
      sub_category
      naics_code
      phone_number
      open_hours
      category_tags
      opened_on
      closed_on
      tracking_closed_since
      geometry_type
    }
  }
}
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  lookup(placekey: \"[email protected]\") {\n    safegraph_core {\n      placekey\n      latitude\n      longitude\n      street_address\n      city\n      region\n      postal_code\n      iso_country_code\n      parent_placekey\n      location_name\n      safegraph_brand_ids\n      brands\n      top_category\n      sub_category\n      naics_code\n      phone_number\n      open_hours\n      category_tags\n      opened_on\n      closed_on\n      tracking_closed_since\n      geometry_type\n    }\n  }\n}","variables":{}}'
# pip install safegraphQL
import safegraphql.client as sgql

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

pk = '[email protected]'
cols = [
    'latitude',
    'longitude',
    'street_address',
    'city',
    'region',
    'postal_code',
    'iso_country_code',
    'parent_placekey',
    'location_name',
    'safegraph_brand_ids',
    'brands',
    'top_category',
    'sub_category',
    'naics_code',
    'phone_number',
    'open_hours',
    'category_tags',
    'opened_on',
    'closed_on',
    'tracking_closed_since',
    'geometry_type',
]

sgql_client.lookup(product = 'core', placekeys = pk, columns = cols)
{
  "data": {
    "lookup": {
      "safegraph_core": {
        "placekey": "[email protected]",
        "latitude": 47.620579,
        "longitude": -122.349186,
        "street_address": "400 Broad St",
        "city": "Seattle",
        "region": "WA",
        "postal_code": "98109",
        "iso_country_code": "US",
        "parent_placekey": null,
        "location_name": "Space Needle",
        "brands": [],
        "top_category": "Museums, Historical Sites, and Similar Institutions",
        "sub_category": "Historical Sites",
        "naics_code": 712120,
        "phone_number": null,
        "open_hours": "{ \"Mon\": [[\"10:00\", \"20:00\"]], \"Tue\": [[\"10:00\", \"20:00\"]], \"Wed\": [[\"10:00\", \"20:00\"]], \"Thu\": [[\"10:00\", \"20:00\"]], \"Fri\": [[\"10:00\", \"20:00\"]], \"Sat\": [[\"10:00\", \"20:00\"]], \"Sun\": [[\"10:00\", \"20:00\"]] }",
        "category_tags": [],
        "opened_on": null,
        "closed_on": null,
        "tracking_closed_since": "2019-07-01",
        "geometry_type": "POLYGON"
      }
    }
  },
  "extensions": {
    "row_count": 1,
    "version_date": "1635494405__2021_10"
  }
}

Use the GraphiQL Explorer to adjust the above lookup and see what else you can find out about this given POI.